Skip to content

Commit

Permalink
Merge pull request #47 from Formulka/FixValidateContentTypeFromExtension
Browse files Browse the repository at this point in the history
AllowedContentTypesFileValidator should work with all django File objects
  • Loading branch information
matllubos committed May 30, 2017
2 parents ab4301e + 4085fbe commit 68b34d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chamber/models/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __init__(self, content_types):
self.content_types = content_types

def __call__(self, data):
extension_mime_type = mimetypes.guess_type(data.file.name)[0]
extension_mime_type = mimetypes.guess_type(data.name)[0]
mime_type = None
with magic.Magic(flags=magic.MAGIC_MIME_TYPE) as m:
mime_type = m.id_buffer(data.file.read(1024))
Expand Down

0 comments on commit 68b34d0

Please sign in to comment.