[elbe-devel] [PATCH 2/8] elbepack: db: remove modify_user()
Thomas Weißschuh
thomas.weissschuh at linutronix.de
Tue Aug 13 13:31:50 CEST 2024
It is not used.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
elbepack/db.py | 24 ------------------------
1 file changed, 24 deletions(-)
diff --git a/elbepack/db.py b/elbepack/db.py
index 681a570fdc0a..540a5bb07fe6 100644
--- a/elbepack/db.py
+++ b/elbepack/db.py
@@ -745,30 +745,6 @@ class ElbeDB:
raise ElbeDBError(f'user {name} already exists in the database')
s.add(u)
- def modify_user(self, userid, name, fullname, email, admin,
- password=None):
-
- with session_scope(self.session) as s:
- try:
- u = s.query(User).filter(User.id == userid).one()
- except NoResultFound:
- raise ElbeDBError(f'no user with id {userid}')
-
- # If a user name change is requested, check for uniqueness
- if name != u.name:
- if s.query(User).filter(User.name == name).count() > 0:
- raise ElbeDBError(
- f'user {name} already exists in the database')
-
- u.name = name
- u.fullname = fullname
- u.email = email
- u.admin = admin
-
- # Update password only if given
- if password is not None:
- u.pwhash = pbkdf2_sha512.hash(password)
-
def validate_login(self, name, password):
with session_scope(self.session) as s:
# Find the user with the given name
--
2.46.0
More information about the elbe-devel
mailing list