Initial go

This commit is contained in:
2025-12-11 12:37:11 -05:00
parent 7efc2ef37a
commit 9cfd88d848
4 changed files with 145 additions and 1 deletions

View File

@@ -50,5 +50,14 @@ class CRUDUser:
# For future use if we add user status
return True
def change_password(self, db: Session, db_obj: User, new_password: str) -> User:
"""Change a user's password (typically used by admins to reset another user's password)"""
hashed_password = get_password_hash(new_password)
db_obj.password = hashed_password
db.add(db_obj)
db.commit()
db.refresh(db_obj)
return db_obj
user = CRUDUser()