Skip to content

Commit

Permalink
fix: reset_user_by_next
Browse files Browse the repository at this point in the history
  • Loading branch information
ImMohammad20000 authored Jan 14, 2025
1 parent 1ce8c21 commit 2353e3f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/db/crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ def reset_user_by_next(db: Session, dbuser: User) -> User:

dbuser.data_limit = dbuser.next_plan.data_limit + \
(0 if dbuser.next_plan.add_remaining_traffic else dbuser.data_limit - dbuser.used_traffic)
dbuser.expire = dbuser.next_plan.expire
dbuser.expire = int((timedelta(seconds=dbuser.next_plan.expire) + datetime.utcnow()).timestamp())

dbuser.used_traffic = 0
db.delete(dbuser.next_plan)
Expand Down

0 comments on commit 2353e3f

Please sign in to comment.