refactor(endpoints/api/superuser*): refactored code behind db model
this moves all the db model code behind an interface in prep for v2-2 Issue: https://coreosdev.atlassian.net/browse/QUAY-750 - [ ] It works! - [ ] Comments provide sufficient explanations for the next contributor - [ ] Tests cover changes and corner cases - [ ] Follows Quay syntax patterns and format
This commit is contained in:
parent
3688b6a8df
commit
6c29ec873a
4 changed files with 751 additions and 177 deletions
|
@ -217,6 +217,11 @@ def update_email(user, new_email, auto_verify=False):
|
|||
raise DataModelException('E-mail address already used')
|
||||
|
||||
|
||||
def update_enabled(user, set_enabled):
|
||||
user.enabled = set_enabled
|
||||
user.save()
|
||||
|
||||
|
||||
def create_robot(robot_shortname, parent):
|
||||
(username_valid, username_issue) = validate_username(robot_shortname)
|
||||
if not username_valid:
|
||||
|
|
Reference in a new issue