From 44ace418c7e81ca73e6c87c130d09498c72daf9b Mon Sep 17 00:00:00 2001 From: Joshua Laymon Date: Sat, 30 Aug 2025 03:17:44 +0000 Subject: [PATCH] Update web/core/forms.py --- web/core/forms.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/core/forms.py b/web/core/forms.py index a15781b..b7fc75d 100644 --- a/web/core/forms.py +++ b/web/core/forms.py @@ -1,6 +1,7 @@ from django import forms from .models_ann import Announcement from django.forms import ModelForm, Textarea +from django.utils import timezone class ImportForm(forms.Form): @@ -67,4 +68,8 @@ class AnnouncementForm(ModelForm): fields = ["title", "message", "is_active", "start_at", "end_at"] widgets = { "message": Textarea(attrs={"rows": 6, "placeholder": "What’s new in this release…"}), - } \ No newline at end of file + } + + def clean_start_at(self): + v = self.cleaned_data.get("start_at") + return v or timezone.now() \ No newline at end of file