Some of the ModelView based endpoints were missing a distinct name that could be used for url_for, and instead string concatenation was used (mostly in templates). I also moved some logic out of templates (e.g. calculation of total pay), added helper methods and made some other changed to reduce the code needed in the templates and improve readability a little bit.
I also added an anonymous user class that is useful to call things like .is_admin_or_coordinator(department) on any current_user object, without first making sure the user is not anonymous.
Tests and linting
[x] This branch is up-to-date with the develop branch.
[x] pytest passes on my local development environment.
[x] pre-commit passes on my local development environment.
Description of Changes
Some of the
ModelView
based endpoints were missing a distinct name that could be used forurl_for
, and instead string concatenation was used (mostly in templates). I also moved some logic out of templates (e.g. calculation of total pay), added helper methods and made some other changed to reduce the code needed in the templates and improve readability a little bit.I also added an anonymous user class that is useful to call things like
.is_admin_or_coordinator(department)
on anycurrent_user
object, without first making sure the user is not anonymous.Tests and linting
develop
branch.pytest
passes on my local development environment.pre-commit
passes on my local development environment.