Good codeQL

This commit is contained in:
shamoon 2024-12-04 11:32:29 -08:00
parent a7c6249be3
commit 23c3dfe884

View File

@ -1150,8 +1150,9 @@ class BulkEditSerializer(
try: try:
ids = [int(i[0]) for i in custom_fields.items()] ids = [int(i[0]) for i in custom_fields.items()]
except Exception as e: except Exception as e:
logger.exception(f"Error validating custom fields: {e}")
raise serializers.ValidationError( raise serializers.ValidationError(
f"{name} must be a list of integers or a dict of key-value pairs: {e}", f"{name} must be a list of integers or a dict of key-value pairs, see the log for details",
) )
elif not isinstance(custom_fields, list) or not all( elif not isinstance(custom_fields, list) or not all(
isinstance(i, int) for i in ids isinstance(i, int) for i in ids