mirror of
https://github.com/jointakahe/takahe.git
synced 2024-11-28 18:21: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()
|
||||
for attachment in get_list(data, "attachment"):
|
||||
if "focalPoint" in attachment:
|
||||
try:
|
||||
focal_x, focal_y = attachment["focalPoint"]
|
||||
except (ValueError, TypeError):
|
||||
focal_x, focal_y = None, None
|
||||
else:
|
||||
focal_x, focal_y = None, None
|
||||
mimetype = attachment.get("mediaType")
|
||||
|
|
Loading…
Reference in a new issue