jazzband / django-downloadview

Serve files with Django.
https://django-downloadview.readthedocs.io
Other
380 stars 58 forks source link

Fix IF_MODIFIED_SINCE fallback handling #95

Closed benesch closed 9 years ago

benesch commented 9 years ago

django.views.static.was_modified_since takes a numeric Unix timestamp, not a datetime.datetime. Convert our file wrapper's modified_time property to a Unix timestamp before passing it along.

Failing tests (that now pass) included!

benoitbryon commented 9 years ago

Nice catch @benesch! Thanks! The proposal looks nice. I'll try to make the review and merge on monday/tuesday...

Natim commented 9 years ago

Thank you for that, it is a really good catch. I think we should also add an example in the documentation.

benesch commented 9 years ago

Great! Glad I could help. I'll patch up the test names tomorrow.