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

@@ -79,7 +79,7 @@ class ClearableBasenameFileInput(forms.ClearableFileInput):
@property
def is_img(self):
return any(self.file.name.endswith(e) for e in ('.jpg', '.jpeg', '.png', '.gif'))
return any(self.file.name.lower().endswith(e) for e in ('.jpg', '.jpeg', '.png', '.gif'))
def __str__(self):
return os.path.basename(self.file.name).split('.', 1)[-1]