Skip to content

Commit

Permalink
This code violates the tator schema as thumbnail_image is not setab…
Browse files Browse the repository at this point in the history
…le via REST
  • Loading branch information
bctcvai committed Aug 13, 2024
1 parent 0e9b2bc commit 3fc33dd
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions api/main/rest/localization.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def patch_qs(self, params, qs):
y = params.get("y", None)
height = params.get("height", None)
width = params.get("width", None)
thumbnail_image = params.get("thumbnail_image", None)

if x is not None:
obj.x = x
if y is not None:
Expand All @@ -397,13 +397,6 @@ def patch_qs(self, params, qs):
if (x or y or height or width) and obj.thumbnail_image:
obj.thumbnail_image.delete()

if thumbnail_image:
try:
thumbnail_obj = Media.objects.get(pk=thumbnail_image)
except Media.DoesNotExist:
logger.error("Bad thumbnail reference given")
else:
obj.thumbnail_image = thumbnail_obj
elif obj.type.dtype == "line":
x = params.get("x", None)
y = params.get("y", None)
Expand Down

0 comments on commit 3fc33dd

Please sign in to comment.