diff --git a/backend/app/services/progress_service.py b/backend/app/services/progress_service.py index e31bdb3..5521954 100644 --- a/backend/app/services/progress_service.py +++ b/backend/app/services/progress_service.py @@ -33,9 +33,9 @@ class ProgressService: self.session.add(row) today = date.today() if row.last_ac_date != today: - row.day_done += 1 + row.day_done = (row.day_done or 0) + 1 if row.last_ac_date and (today - row.last_ac_date).days == 1: - row.streak_days += 1 + row.streak_days = (row.streak_days or 0) + 1 elif row.last_ac_date != today: row.streak_days = 1 row.last_ac_date = today