Comparison for file extensions should be case insensitive (#1563)

This commit is contained in:
Alexander Schwartz
2020-02-04 17:09:12 +01:00
committed by GitHub
parent fd1c964c92
commit 833cd32578
3 changed files with 3 additions and 3 deletions

View File

@@ -900,7 +900,7 @@ class QuestionAnswer(models.Model):
@property
def is_image(self):
return any(self.file.name.endswith(e) for e in ('.jpg', '.png', '.gif', '.tiff', '.bmp', '.jpeg'))
return any(self.file.name.lower().endswith(e) for e in ('.jpg', '.png', '.gif', '.tiff', '.bmp', '.jpeg'))
@property
def file_name(self):