Skip to content

Commit

Permalink
Bug fix refactoring detecting mime types
Browse files Browse the repository at this point in the history
  • Loading branch information
asset-web committed Oct 25, 2024
1 parent f8f483b commit 55efed6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion browser/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def __init__(self, mimetypes):

def __call__(self, value):
try:
mime = mimetypes.guess_type(value)
mime = mimetypes.guess_type(value.temporary_file_path())
if mime[0] not in self.mimetypes:
raise ValidationError('%s is not an acceptable file type. Please use a %s formatted file instead.' % (value, ' or '.join(self.mimetypes)))
except AttributeError as e:
Expand Down

0 comments on commit 55efed6

Please sign in to comment.