Skip to content

Commit 8f323f0

Browse files
committed
Make nothing-found-case work for SQLalchemy 2.0
1 parent ee44ed8 commit 8f323f0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

api/src/core/auth.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,8 @@ def password_reset(reset_token, unhashed_password):
131131
except ValueError as e:
132132
raise BadRequest(str(e))
133133

134-
try:
135-
member = db_session.get(Member, password_reset_token.member_id)
136-
except NoResultFound:
134+
member = db_session.get(Member, password_reset_token.member_id)
135+
if member is None:
137136
raise InternalServerError(log=f"No member with id {password_reset_token.member_id} found, this is a bug.")
138137

139138
member.password = hashed_password

0 commit comments

Comments
 (0)