-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use database constraints instead of python asserts #1957
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure to run manage.py format
:) Secondly, I think the constraints could all use some nicer names, I made a suggestion for one of them below, we can also come up with the others together if you want.
evap/evaluation/migrations/0132_evaluation_check_vote_date_and_more.py
Outdated
Show resolved
Hide resolved
3794d3c
to
cad4659
Compare
evap/evaluation/migrations/0136_evaluation_check_evaluation_start_before_end_and_more.py
Outdated
Show resolved
Hide resolved
evap/evaluation/migrations/0136_evaluation_check_evaluation_start_before_end_and_more.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good. As discussed, please check whether the error message on an evaluation edit/create pages in the error case "end date is before start datetime" is unchanged.
It does in fact still produce the correct error message. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!
evap/evaluation/migrations/0136_use_more_database_constraints.py
Outdated
Show resolved
Hide resolved
I'll update the migration file and merge it real quick :) |
This implements all reasonable constraints as requested in #1800.