galacticpuzzlehunt / gph-site

Django app for running a puzzlehunt (open-source version)
MIT License
62 stars 31 forks source link

add tests on hint.answered_datetime #25

Closed enigmathix closed 2 years ago

enigmathix commented 2 years ago

If an admin leaves the answered date as empty when acting on a hint in the admin interface (e.g. by refunding it), looking at the hint page at the next interaction (e.g. answering the hint from the discord link) will cause the page to crash because there's no test on hint.answered_datetime in a couple of places before calculating the time since it was answered.

Steps to reproduce:

Fix is to add a couple of tests on hint.answered_datetime in templates/hint.html, as it was done in other places in the code.