forked from MarseyWorld/MarseyWorld
inline is_image
parent
6b0fe97a85
commit
61cc1ddcb7
|
@ -398,9 +398,7 @@ class Submission(Base):
|
||||||
@property
|
@property
|
||||||
@lazy
|
@lazy
|
||||||
def is_image(self):
|
def is_image(self):
|
||||||
if self.url and (self.url.lower().endswith('.webp') or self.url.lower().endswith('.jpg') or self.url.lower().endswith('.png') or self.url.lower().endswith('.gif') or self.url.lower().endswith('.jpeg') or self.url.lower().endswith('?maxwidth=9999') or self.url.lower().endswith('&fidelity=high')) and is_safe_url(self.url):
|
return self.url and any((self.url.lower().endswith(x) for x in ('.webp','.jpg','.png','.gif','.jpeg','?maxwidth=9999','&fidelity=high'))) and is_safe_url(self.url)
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
@lazy
|
@lazy
|
||||||
def filtered_flags(self, v):
|
def filtered_flags(self, v):
|
||||||
|
|
Loading…
Reference in New Issue