refactor(campaigns): remove dead future-start_date scheduling code

Now that only the manager sets start_date, and only at the moment of
approval (which immediately activates the campaign), a draft campaign
can never have a start_date. This made three things permanently
unreachable: the hourly _run_scheduled_campaign_activation cron job,
the activate_campaign 409/force future-date guard, and a query filter
hiding tests from scheduled-but-inactive draft campaigns. Removes all
three rather than leaving dead code behind. Also adds the missing
manager-cannot-directly-activate router test.
This commit is contained in:
kitos
2026-07-03 13:57:43 +02:00
parent 959def2f49
commit 5bc71f677f
4 changed files with 14 additions and 140 deletions
@@ -279,6 +279,13 @@ def test_admin_can_still_directly_activate_as_override(api, db, red_lead_user, r
assert resp.json()["status"] == "active"
def test_manager_cannot_directly_activate_draft_campaign(api, db, red_lead_user, manager_headers):
"""A manager approves via /approve — the direct /activate bypass is admin-only."""
campaign = _make_draft_campaign(db, red_lead_user.id)
resp = api("post", f"/api/v1/campaigns/{campaign.id}/activate", manager_headers)
assert resp.status_code == 403
def test_create_campaign_payload_has_no_start_date_field(api, db, red_lead_headers):
resp = api(
"post",