diff --git a/server/atheneum/__init__.py b/server/atheneum/__init__.py index 29895b4..f07f898 100644 --- a/server/atheneum/__init__.py +++ b/server/atheneum/__init__.py @@ -36,7 +36,7 @@ def create_app(test_config=None): app.config.from_mapping( SECRET_KEY='dev', SQLALCHEMY_DATABASE_URI='sqlite:///{}/atheneum.db' - .format(data_directory), + .format(data_directory), SQLALCHEMY_TRACK_MODIFICATIONS=False ) diff --git a/server/atheneum/service/user_service.py b/server/atheneum/service/user_service.py index fa1b31a..4c2a4a1 100644 --- a/server/atheneum/service/user_service.py +++ b/server/atheneum/service/user_service.py @@ -7,14 +7,13 @@ from atheneum.service import authentication_service def register(name: str, password: str, role: str) -> User: - password_hash, password_revision = authentication_service.get_password_hash( - password) + pw_hash, pw_revision = authentication_service.get_password_hash(password) new_user = User( name=name, role=role, - password_hash=password_hash, - password_revision=password_revision, + password_hash=pw_hash, + password_revision=pw_revision, creation_time=datetime.now(), version=0) db.session.add(new_user) @@ -38,10 +37,10 @@ def update_last_login_time(user: User): def update_password(user: User, password: str): - password_hash, password_revision = authentication_service.get_password_hash( + pw_hash, pw_revision = authentication_service.get_password_hash( password) - user.password_hash = password_hash - user.password_revision = password_revision + user.password_hash = pw_hash + user.password_revision = pw_revision db.session.commit() diff --git a/server/atheneum/service/user_token_service.py b/server/atheneum/service/user_token_service.py index c98a765..65b4dad 100644 --- a/server/atheneum/service/user_token_service.py +++ b/server/atheneum/service/user_token_service.py @@ -15,7 +15,8 @@ def create( Create and save a UserToken :param user: The User object to bind the token to - :param note: An optional field to store additional information about a token + :param note: An optional field to store additional information about a + token :param enabled: A boolean to indicate whether a token can be considered eligible for authentication :param expiration_time: An optional argument to determine when the token @@ -49,4 +50,3 @@ def delete(user_token: UserToken) -> bool: def find_by_user_and_token(user: User, token: str) -> Optional[UserToken]: return UserToken.query.filter_by(user_id=user.id, token=token).first() -