Pierre-Sassoulas / django-survey

A django survey app that can export results as CSV or PDF using your native language.
GNU Affero General Public License v3.0
217 stars 145 forks source link

Misleading error message #116

Closed ebdavison closed 3 years ago

ebdavison commented 3 years ago

When a survey has an expiration date, and a user tries to go to the survey link, the message displayed on the screen is:

Not Found
The requested resource was not found on this server.

And in the logs, the request is logged as a 404 error:

1.2.3.4 - - [12/Jan/2021:02:23:03 +0000] "GET /survey/35/ HTTP/1.1" 404 179 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36" "-"

This is quite misleading and has led me down a rabbit hole for 4 days to try to track this down. I was finally looking through the database directly with an SQL client and just happened to see the expire date and it caught my attention. Once I changed the expire date to the future, I was able to get to the survey and the request logs as 200 OK now.

Seems like the proper handling of this is a message that says the survey has been closed for new submissions rather than a 404 Not Found.

Pierre-Sassoulas commented 3 years ago

Thank you for tracking this one. Sorry it was probably introduced in #75 did not thought of that during review.

The solution you give seems sensible, I'd merge it !