Commit 621e459d authored by Kevin Morris's avatar Kevin Morris
Browse files

aurweb.models.user: Remove session.commit() from construction



We don't want to do this on construction. We only want to do this
when we want to actually add the user to the database (or modify it).
Signed-off-by: Kevin Morris's avatarKevin Morris <kevr@0cost.org>
parent f8a6049d
......@@ -51,11 +51,9 @@ class User:
self.update_password(passwd)
def update_password(self, password, salt_rounds=12):
from aurweb.db import session
self.Passwd = bcrypt.hashpw(
password.encode(),
bcrypt.gensalt(rounds=salt_rounds)).decode()
session.commit()
@staticmethod
def minimum_passwd_length():
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment