caktus / django-sticky-uploads

Enhanced file input widget for Django which uploads the file in the background and retains value on form errors.
BSD 3-Clause "New" or "Revised" License
32 stars 9 forks source link

Do not display link for temporary uploads. #11

Closed bmihelac closed 10 years ago

bmihelac commented 10 years ago

I guess it is better to just show uploaded document name then a non working link.

bmihelac commented 10 years ago

Ops django 1.4 and 1.5 issues

ref: https://github.com/django/django/commit/51cc7029b96d028989e92a185a2f88b89283d287

mlavin commented 10 years ago

I like this idea. Couldn't work around this by checking for the existence of url_markup_template (which won't be found for 1.4/1.5) before making the swap? 1.4/1.5 users would still have this broken link but those versions won't be supported forever.

bmihelac commented 10 years ago

It is not even needed to check for url_markup_template (as it would not be used in 1.4/1.5 versions), we would just need to expect different results in test_render_with_restored_file, probably with skipIf. What do you think?

mlavin commented 10 years ago

True this would be slightly ugly to test since there would different output by Django version. As long as it is clear in the test why it is skipped or why the output assertion is different per version I would be fine with it. By clear I mean that when reading the code/test it should be obvious that this can be removed when 1.4/1.5 support is eventually dropped.

bmihelac commented 10 years ago

Done, seems good?

mlavin commented 10 years ago

Looks good to me. Thanks! :sailboat:

bmihelac commented 10 years ago

Thanks!