From 55efed631a8b35075cac0a7aa13b329769bd8e7a Mon Sep 17 00:00:00 2001 From: Tessa Alexander Date: Fri, 25 Oct 2024 15:32:21 +0100 Subject: [PATCH] Bug fix refactoring detecting mime types --- browser/validators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser/validators.py b/browser/validators.py index 1fa3b2c..79c3402 100644 --- a/browser/validators.py +++ b/browser/validators.py @@ -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: