Update web/core/forms.py
This commit is contained in:
parent
37edcf92e6
commit
44ace418c7
@ -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):
|
||||
@ -68,3 +69,7 @@ class AnnouncementForm(ModelForm):
|
||||
widgets = {
|
||||
"message": Textarea(attrs={"rows": 6, "placeholder": "What’s new in this release…"}),
|
||||
}
|
||||
|
||||
def clean_start_at(self):
|
||||
v = self.cleaned_data.get("start_at")
|
||||
return v or timezone.now()
|
||||
Loading…
Reference in New Issue
Block a user