svthalia / concrexit

Thalia Website built on Django.
https://thalia.nu
Other
22 stars 11 forks source link

Fix check if you are allowed to order food #3720

Closed DeD1rk closed 3 weeks ago

DeD1rk commented 3 weeks ago

Closes #3714.

Supersedes #3718 which had a wrong target branch.

Summary

Made it so that you are not able to order food when the ordering has not started or the event has ended. Also fixed that you were able to order food to registration required events if you are not registered or are in the queue of the event you are ordering food at.

How to test

Make a new Food event and set the time to expire in like a minute. Try to order food when the food event has ended if you are back to the index page of pizza, then this is correct. You should not be able to order food when the event has expired. Make a new food event and do not register for the event that requires registration, then try to order food if you are redirected to the index page of pizza, this is correct. You should again not be able to order food.

DeD1rk commented 3 weeks ago

@BPC2004 I forgot Wednesday but while this fixed the actual problem, it needs some frontend changes as well. We need to make it clear to users in advance that they can't order and why, and not just allow them to press the button and then see an error.