Coach lineup polish, referee level/position delete, feature-flag nav gating, per-job pause
- Coach line-up screen: more breathing room above the sheet, brighter event subtitle, and the "Schedule" button now matches the date input's height. - Positions and referee levels can now be deleted from Settings (blocked with a friendly message if still in use on a roster/referee profile/inheritance chain). - The Evaluations nav placeholder is now gated on the formbuilder flag, same as Forms itself, since the design reuses formbuilder underneath. - Control panel: each scheduled platform job can now be paused/resumed individually (features.models.JobToggle), independent of the platform-wide Maintenance lock. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -14,7 +14,7 @@ from billing.services import BillingError
|
||||
from billing.services.dues import archivable_clubs, renew, subscriptions_due_for_renewal
|
||||
from billing.services.reminders import reminders_to_send, send_reminder
|
||||
from club.models import Club
|
||||
from features.models import Maintenance
|
||||
from features.models import JobToggle, Maintenance
|
||||
|
||||
|
||||
def _stand_down():
|
||||
@@ -22,10 +22,16 @@ def _stand_down():
|
||||
raise RuntimeError("Platform is in maintenance mode; this job stood down.")
|
||||
|
||||
|
||||
def _check_enabled(name):
|
||||
if not JobToggle.is_enabled(name):
|
||||
raise RuntimeError("This job is disabled in the control panel.")
|
||||
|
||||
|
||||
@shared_task(name="billing.tasks.renew_subscriptions")
|
||||
def renew_subscriptions():
|
||||
if Maintenance.is_on():
|
||||
_stand_down()
|
||||
_check_enabled("billing.tasks.renew_subscriptions")
|
||||
|
||||
due_for_renewal = subscriptions_due_for_renewal()
|
||||
if not due_for_renewal:
|
||||
@@ -50,6 +56,7 @@ def renew_subscriptions():
|
||||
def send_billing_reminders():
|
||||
if Maintenance.is_on():
|
||||
_stand_down()
|
||||
_check_enabled("billing.tasks.send_billing_reminders")
|
||||
|
||||
clubs = Club.objects.active().select_related("subscription", "subscription__plan").order_by("name")
|
||||
sendable = [result for result in reminders_to_send(clubs) if result.sent]
|
||||
@@ -76,6 +83,7 @@ def send_billing_reminders():
|
||||
def archive_overdue_clubs():
|
||||
if Maintenance.is_on():
|
||||
_stand_down()
|
||||
_check_enabled("billing.tasks.archive_overdue_clubs")
|
||||
|
||||
overdue = list(archivable_clubs(timezone.localdate()))
|
||||
for due in overdue:
|
||||
|
||||
Reference in New Issue
Block a user