mixkorshun / django-safe-filefield

Secure file field, which allows you to restrict uploaded file extensions.
MIT License
53 stars 10 forks source link

Handle FieldFile-like instance in FileContentTypeValidator #6

Closed rvause closed 1 year ago

rvause commented 5 years ago

Looks like there are cases where FileContentTypeValidator receives a FieldFile object that does not have a content_type attribute. Attempts to fix issue #4 by getting the UploadedFile instance from a FieldFile object.

(adds Django 2.x to test matrix)

codecov-io commented 5 years ago

Codecov Report

Merging #6 into master will increase coverage by 0.21%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #6      +/-   ##
==========================================
+ Coverage   93.72%   93.93%   +0.21%     
==========================================
  Files          11       11              
  Lines         255      264       +9     
==========================================
+ Hits          239      248       +9     
  Misses         16       16
Impacted Files Coverage Δ
safe_filefield/validators.py 88.67% <100%> (+0.44%) :arrow_up:
safe_filefield/tests/test_validators.py 94.59% <100%> (+0.56%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 225a48c...24f1216. Read the comment docs.