coldfront
coldfront copied to clipboard
Refactor of Allocation views.py
I noticed the note on messy logic in AllocationChangeView.post() and thought I would try simplifying the method a bit. To eliminate unnecessary else statements and make it easier to follow the method logic, I changed the if statements to look for errors instead of check whether conditions were right to proceed.
I also performed a few other small refactoring tasks - removed unused imports, made small restructures to remove repeating code, removed unneeded else statements where they did not appear to improve legibility, etc.
I also added two functions for checking the permissions statuses of different users which I found helpful in the development of permissions-dependent views on the FASRC branch.