Skip to content

Commit

Permalink
fix(user): record user.id instead of user_id
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogay committed Nov 4, 2024
1 parent 934d563 commit 9994e6a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions mongo/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,17 @@ def login(cls, username, password, ip_addr):
user_id = hash_id(user.username, password)
if (compare_digest(user.user_id, user_id)
or compare_digest(user.user_id2, user_id)):
engine.LoginRecords(user_id=user_id, ip_addr=ip_addr,
success=True).save(force_insert=True)
engine.LoginRecords(
user_id=user.id,
ip_addr=ip_addr,
success=True,
).save(force_insert=True)
return user
engine.LoginRecords(user_id=user_id,
ip_addr=ip_addr).save(force_insert=True)
engine.LoginRecords(
user_id=user.id,
ip_addr=ip_addr,
success=False,
).save(force_insert=True)
raise engine.DoesNotExist

@classmethod
Expand Down

0 comments on commit 9994e6a

Please sign in to comment.