The edit_user() function is clunky and could stand to undergo some improvements. Namely:
the reset behavior for editable fields is inconsistent. For example, an association's projects list can be reset with -1, but their queues list is reset with an empty string.
the function parameters define every editable field in the signature when it really could just use **kwargs.
The function allows bank to be edited for an association, which should not be allowed since associations, once created, are not deleted because they can continue to contribute to a bank's fair-share (up to the job usage reset period).
This PR changes the function's signature to use **kwargs for the editable fields and removes "bank" as an editable field for an association. It also unifies the reset behavior for any of the editable fields by making -1 the keyword to reset the field to its default value.
Finally, I've added a function docstring description.
Problem
The
edit_user()
function is clunky and could stand to undergo some improvements. Namely:projects
list can be reset with-1
, but theirqueues
list is reset with an empty string.**kwargs
.bank
to be edited for an association, which should not be allowed since associations, once created, are not deleted because they can continue to contribute to a bank's fair-share (up to the job usage reset period).This PR changes the function's signature to use
**kwargs
for the editable fields and removes "bank" as an editable field for an association. It also unifies the reset behavior for any of the editable fields by making-1
the keyword to reset the field to its default value.Finally, I've added a function docstring description.