kopia lustrzana https://github.com/wagtail/wagtail
Embeds: Catch TypeErrors when casting width and height to integers
rodzic
1ecc215759
commit
5474f7ef39
|
@ -155,12 +155,12 @@ def get_embed(url, max_width=None, finder=None):
|
|||
# Make sure width and height are valid integers before inserting into database
|
||||
try:
|
||||
embed_dict['width'] = int(embed_dict['width'])
|
||||
except ValueError:
|
||||
except (TypeError, ValueError):
|
||||
embed_dict['width'] = None
|
||||
|
||||
try:
|
||||
embed_dict['height'] = int(embed_dict['height'])
|
||||
except ValueError:
|
||||
except (TypeError, ValueError):
|
||||
embed_dict['height'] = None
|
||||
|
||||
# Create database record
|
||||
|
|
Ładowanie…
Reference in New Issue