Skip to content
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

edit-user: unify reset behavior, **kwargs for editable fields #535

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

cmoussa1
Copy link
Member

Problem

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.

@cmoussa1 cmoussa1 added the improvement Upgrades to an already existing feature label Nov 13, 2024
Problem: 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).

Change the function's signature to use **kwargs for the editable
fields.

Remove "bank" as an editable field for an association.

Unify the reset behavior for any of the editable fields by making -1
the keyword to reset the field to its default value.

Add a function docstring description.
Copy link
Member

@jameshcorbett jameshcorbett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of different small changes in one commit but they are all related I guess so LGTM!

@mergify mergify bot merged commit 1e6b306 into flux-framework:master Nov 22, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Upgrades to an already existing feature merge-when-passing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants