symposion_app/vendor/symposion/speakers/forms.py
Joel Addison f72490b1eb LCA2022 Setup
Update dates and descriptions for LCA2022.
Remove old miniconf proposal types.
Add local timezone to speaker profile.
2021-07-05 20:20:24 +10:00

38 lines
998 B
Python

from django import forms
from symposion.speakers.models import Speaker
class SpeakerForm(forms.ModelForm):
required_css_class = 'label-required'
class Meta:
model = Speaker
fields = [
"name",
"biography",
"experience",
"photo",
#"telephone",
"local_timezone",
"homepage",
"twitter_username",
"accessibility",
#"travel_assistance",
#"accommodation_assistance",
#"assistance",
"agreement",
]
def __init__(self, *a, **k):
super(SpeakerForm, self).__init__(*a, **k)
self.fields['agreement'].required = True
self.fields['biography'].required = True
self.fields['local_timezone'].required = True
def clean_twitter_username(self):
value = self.cleaned_data["twitter_username"]
if value.startswith("@"):
value = value[1:]
return value