Skip to content

Commit

Permalink
fix(backend): cronjob
Browse files Browse the repository at this point in the history
  • Loading branch information
maxidragon committed Oct 5, 2024
1 parent 4998248 commit 45e2014
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions backend/daily_tasks/cron.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@

def move_uncompleted_tasks_to_the_next_day():
print('Moving uncompleted tasks to the next day')
#yesterday = datetime.now().date() - timedelta(days=1)
yesterday = datetime.now().date().strftime("%Y-%m-%d")
yesterday = datetime.now().date() - timedelta(days=1)
date_obj = datetime.strptime(yesterday, "%Y-%m-%d")
uncompleted_tasks = DailyTask.objects.filter(
date__year=date_obj.year, date__month=date_obj.month, date__day=date_obj.day, completed_at=None)
for task in uncompleted_tasks:
#task.date = datetime.now().date()
task.date = datetime.now().date() + timedelta(days=1)
task.date = datetime.now().date()
task.save()

0 comments on commit 45e2014

Please sign in to comment.