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:
@@ -30,10 +30,10 @@ def test_event_reschedule_and_cancellation_notify_registered_users(client, user_
|
||||
assert event.location == "New hall"
|
||||
assert notify.call_args.args[1]["type"] == "event_rescheduled"
|
||||
sms.assert_called_with(attendee.mobile, "event_reschedule", event.title)
|
||||
cancelled = _put(client, path, {"status": Event.StatusChoices.CANCELLED}, auth_headers(staff))
|
||||
cancelled = _put(client, path, {"is_cancelled": True}, auth_headers(staff))
|
||||
assert cancelled.status_code == 200, cancelled.content
|
||||
event.refresh_from_db()
|
||||
assert event.status == Event.StatusChoices.CANCELLED
|
||||
assert event.is_cancelled
|
||||
assert notify.call_args.args[1]["type"] == "event_cancelled"
|
||||
assert sms.call_count == 2
|
||||
|
||||
|
||||
Reference in New Issue
Block a user