coldfront icon indicating copy to clipboard operation
coldfront copied to clipboard

Refactor of Allocation views.py

Open claire-peters opened this issue 2 years ago • 0 comments

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.

claire-peters avatar Jul 27 '22 20:07 claire-peters