|
|
@ -177,7 +177,7 @@ class User(DatabaseModel): |
|
|
def __init__(self, username: str, password: str): |
|
|
def __init__(self, username: str, password: str): |
|
|
"""Create a new user account.""" |
|
|
"""Create a new user account.""" |
|
|
self.username = username |
|
|
self.username = username |
|
|
self.password = password # type: ignore |
|
|
|
|
|
|
|
|
self.password = password |
|
|
|
|
|
|
|
|
def __acl__(self) -> AclType: |
|
|
def __acl__(self) -> AclType: |
|
|
"""Pyramid security ACL.""" |
|
|
"""Pyramid security ACL.""" |
|
|
@ -266,7 +266,7 @@ class User(DatabaseModel): |
|
|
raise ValueError("New password is the same as old password") |
|
|
raise ValueError("New password is the same as old password") |
|
|
|
|
|
|
|
|
# disable mypy on this line because it doesn't handle setters correctly |
|
|
# disable mypy on this line because it doesn't handle setters correctly |
|
|
self.password = new_password # type: ignore |
|
|
|
|
|
|
|
|
self.password = new_password |
|
|
|
|
|
|
|
|
def is_correct_two_factor_code(self, code: str) -> bool: |
|
|
def is_correct_two_factor_code(self, code: str) -> bool: |
|
|
"""Verify that a TOTP/backup code is correct.""" |
|
|
"""Verify that a TOTP/backup code is correct.""" |
|
|
|