Skip to content

Commit

Permalink
Use file url
Browse files Browse the repository at this point in the history
  • Loading branch information
hblankenship authored Nov 6, 2024
1 parent 97d7607 commit f09ba55
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions dojo/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,10 +747,9 @@ def clean(self):
if not self.title:
self.title = "<No Title>"

title = self.title
valid_extensions = settings.FILE_UPLOAD_TYPES

if Path(title).suffix.lower() not in valid_extensions:
if Path(self.file.url).suffix.lower() not in valid_extensions:
if accepted_extensions := f"{', '.join(valid_extensions)}":
msg = (
_("Unsupported extension. Supported extensions are as follows: %s") % accepted_extensions
Expand Down

0 comments on commit f09ba55

Please sign in to comment.