Skip to content

Commit

Permalink
add back account restoration
Browse files Browse the repository at this point in the history
  • Loading branch information
tnix100 committed Sep 9, 2024
1 parent 6c9d4c8 commit 7d01006
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ def __init__(self, data: AccSessionDB):

@classmethod
def create(cls: "AccSession", user: str, ip: str, user_agent: str) -> "AccSession":
# restore account if it is pending deletion
result = db.usersv0.update_one({"_id": user}, {"$set": {"delete_after": None}})
if result.modified_count:
rdb.publish("admin", msgpack.packb({
"op": "alert_user",
"user": user,
"content": "Your account was scheduled for deletion but you logged back in. Your account is no longer scheduled for deletion! If you didn't request for your account to be deleted, please change your password immediately."
}))

data: AccSessionDB = {
"_id": str(uuid.uuid4()),
"user": user,
Expand Down

0 comments on commit 7d01006

Please sign in to comment.