From 018ec31cfc1e48a2391f4619e5c765cb5914a6f2 Mon Sep 17 00:00:00 2001 From: Matthieu B <66959271+mtthidoteu@users.noreply.github.com> Date: Mon, 20 May 2024 14:36:36 +0000 Subject: [PATCH] prep for allowing editing of existing users #414 --- apps/wizarr-backend/wizarr_backend/helpers/users.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/wizarr-backend/wizarr_backend/helpers/users.py b/apps/wizarr-backend/wizarr_backend/helpers/users.py index 6417d5d2..2f7c8f4b 100644 --- a/apps/wizarr-backend/wizarr_backend/helpers/users.py +++ b/apps/wizarr-backend/wizarr_backend/helpers/users.py @@ -163,3 +163,12 @@ def create_user(**kwargs) -> Users: # Return the user return user + +def edit_user_expiration(user_id: int, expiry: datetime) -> Users: + """Add a user expiration date to an existing user or edit existing expiration date""" + user = Users.get_by_id(user_id) + user.expires = expiry + user.save() + return user + + \ No newline at end of file