added gitea activity for fun
This commit is contained in:
@@ -113,6 +113,7 @@ def configure_fasting(
|
||||
'fasting_start_time': fasting_start_time,
|
||||
'fasting_duration_minutes': fasting_duration_minutes,
|
||||
'tracking_started_at': now if enabled else None,
|
||||
'last_phase_notification_at': now,
|
||||
},
|
||||
)
|
||||
if created:
|
||||
@@ -121,9 +122,16 @@ def configure_fasting(
|
||||
return settings
|
||||
|
||||
was_enabled = settings.enabled
|
||||
schedule_changed = (
|
||||
settings.fasting_start_time != fasting_start_time
|
||||
or settings.fasting_duration_minutes != fasting_duration_minutes
|
||||
or was_enabled != enabled
|
||||
)
|
||||
settings.fasting_start_time = fasting_start_time
|
||||
settings.fasting_duration_minutes = fasting_duration_minutes
|
||||
settings.enabled = enabled
|
||||
if schedule_changed:
|
||||
settings.last_phase_notification_at = now
|
||||
if enabled and settings.tracking_started_at is None:
|
||||
settings.tracking_started_at = now
|
||||
settings.save()
|
||||
|
||||
Reference in New Issue
Block a user