mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
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 <kevr@0cost.org>
This commit is contained in:
parent
f8a6049de2
commit
621e459dfb
1 changed files with 0 additions and 2 deletions
|
@ -51,11 +51,9 @@ class User:
|
||||||
self.update_password(passwd)
|
self.update_password(passwd)
|
||||||
|
|
||||||
def update_password(self, password, salt_rounds=12):
|
def update_password(self, password, salt_rounds=12):
|
||||||
from aurweb.db import session
|
|
||||||
self.Passwd = bcrypt.hashpw(
|
self.Passwd = bcrypt.hashpw(
|
||||||
password.encode(),
|
password.encode(),
|
||||||
bcrypt.gensalt(rounds=salt_rounds)).decode()
|
bcrypt.gensalt(rounds=salt_rounds)).decode()
|
||||||
session.commit()
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def minimum_passwd_length():
|
def minimum_passwd_length():
|
||||||
|
|
Loading…
Add table
Reference in a new issue