Skip to content

Commit

Permalink
Update api/api/serializers/image_serializers.py
Browse files Browse the repository at this point in the history
Co-authored-by: Madison Swain-Bowden <[email protected]>
  • Loading branch information
krysal and AetherUnbound authored Sep 27, 2023
1 parent e2fc285 commit bd683b2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions api/api/serializers/image_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,11 @@ def to_internal_value(self, data):

try:
uuid = UUID(identifier)
image = Image.objects.get(identifier=uuid)
except ValueError:
raise serializers.ValidationError(
{"Could not parse identifier from URL.": data["url"]}
)

try:
image = Image.objects.get(identifier=uuid)
except (Image.DoesNotExist, ValidationError):
raise serializers.ValidationError(
{"Could not find image from the provided URL": data["url"]}
Expand Down

0 comments on commit bd683b2

Please sign in to comment.