feat: derive event lifecycle status from dates and flags
Replace persisted event statuses with publication and cancellation flags, and compute public lifecycle labels from event timing and registration capacity. Keep filters, registration checks, and profile responses aligned with the derived status.
This commit is contained in:
@@ -80,7 +80,7 @@ def expire_stale_registration_checkouts(*, now=None, event_id=None):
|
||||
continue
|
||||
reason = (
|
||||
Registration.CancellationReasonChoices.EVENT_CANCELLED
|
||||
if registration.event.status == Event.StatusChoices.CANCELLED
|
||||
if registration.event.is_cancelled
|
||||
else Registration.CancellationReasonChoices.CHECKOUT_EXPIRED
|
||||
)
|
||||
if mark_checkout_cancelled(registration, reason):
|
||||
@@ -105,7 +105,7 @@ def expire_user_registration_checkouts(*, event, user, now):
|
||||
for registration in registrations:
|
||||
reason = (
|
||||
Registration.CancellationReasonChoices.EVENT_CANCELLED
|
||||
if event.status == Event.StatusChoices.CANCELLED
|
||||
if event.is_cancelled
|
||||
else Registration.CancellationReasonChoices.CHECKOUT_EXPIRED
|
||||
)
|
||||
if mark_checkout_cancelled(registration, reason):
|
||||
|
||||
Reference in New Issue
Block a user