mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
Show preview of answered images
This commit is contained in:
@@ -870,6 +870,10 @@ class QuestionAnswer(models.Model):
|
||||
return url
|
||||
return ""
|
||||
|
||||
@property
|
||||
def is_image(self):
|
||||
return any(self.file.name.endswith(e) for e in ('.jpg', '.png', '.gif', '.tiff', '.bmp', '.jpeg'))
|
||||
|
||||
@property
|
||||
def file_name(self):
|
||||
return self.file.name.split('.', 1)[-1]
|
||||
|
||||
Reference in New Issue
Block a user