Skip to content

Commit

Permalink
fix: edit finish storage
Browse files Browse the repository at this point in the history
  • Loading branch information
baebae02 committed Nov 28, 2023
1 parent 64f3055 commit af5c44d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/utils/pray.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,12 @@ def update_storage(storage_id, content) -> StorageDTO:

def finish_storage(storage_id):
storage = Storage.query.filter_by(id=storage_id, user_id=g.user_id).filter(Storage.deleted_at == None).first()
if storage.deadline < datetime.datetime.now():
if storage.deadline > datetime.datetime.now():
raise StorageFail('already finished')
if not storage:
raise StorageFail('storage not found')
try:
storage.deadline = datetime.datetime.now()
storage.deadline = datetime.datetime.now() - datetime.timedelta(days=1)
db.session.commit()
except Exception:
raise StorageFail('finish storage error')
Expand Down

0 comments on commit af5c44d

Please sign in to comment.