imlementation of a user management

This commit is contained in:
2026-08-25 13:29:12 +02:00
parent 7aeb325d4e
commit 7c81a7a6f6
5 changed files with 304 additions and 1 deletions
+22
View File
@@ -219,6 +219,28 @@ def update_user_email_and_token(username, new_email, new_token):
{'$set': {'email': new_email.strip().lower(), 'verification_token': hashed_token}}
)
return result.modified_count > 0
finally:
if client:
client.close()
def update_user_profile(username, contact_person, email):
"""
Aktualisiert die Profilinformationen (Name und E-Mail) eines Nutzers.
"""
client = None
try:
client, users = _get_users_collection()
result = users.update_one(
{'Username': username},
{'$set': {
'contact_person': contact_person,
'email': email.strip().lower()
}}
)
return result.modified_count > 0
except Exception as e:
print(f"Error updating profile: {e}")
return False
finally:
if client:
client.close()