mirror of
https://github.com/jointakahe/takahe.git
synced 2024-11-25 08:41:00 +00:00
Fixed #393: Deal with errors unpacking focalPoint
This commit is contained in:
parent
d51a08ef8c
commit
e20aea1b9c
1 changed files with 4 additions and 1 deletions
|
@ -812,7 +812,10 @@ class Post(StatorModel):
|
||||||
post.attachments.all().delete()
|
post.attachments.all().delete()
|
||||||
for attachment in get_list(data, "attachment"):
|
for attachment in get_list(data, "attachment"):
|
||||||
if "focalPoint" in attachment:
|
if "focalPoint" in attachment:
|
||||||
|
try:
|
||||||
focal_x, focal_y = attachment["focalPoint"]
|
focal_x, focal_y = attachment["focalPoint"]
|
||||||
|
except (ValueError, TypeError):
|
||||||
|
focal_x, focal_y = None, None
|
||||||
else:
|
else:
|
||||||
focal_x, focal_y = None, None
|
focal_x, focal_y = None, None
|
||||||
mimetype = attachment.get("mediaType")
|
mimetype = attachment.get("mediaType")
|
||||||
|
|
Loading…
Reference in a new issue