mgaitan / waliki

A wiki engine powered by Django and Git
http://waliki.pythonanywhere.com
BSD 3-Clause "New" or "Revised" License
309 stars 56 forks source link

Downloading an attachment doesn't work if there's another one an overlapping suffix #141

Closed wagnerflo closed 7 years ago

wagnerflo commented 7 years ago

The view functions in waliki.attachments use endswith to get the database object corresponding to a attachment. If one uploads two attachments with - for example - the names a.pdf and aa.pdf and then tries to download the former there's an error because there are now two entries in the database where the filename ends with a.pdf.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.01%) to 71.131% when pulling 644d932fb4daf84bec949b66e9210e9ac795faa1 on wagnerflo:fix-attachments into 8c2969113f58803c1b842f9f9c88afd1234459c0 on mgaitan:master.