2012-07-12 04:38:24 +00:00
from django import forms
from symposion . speakers . models import Speaker
class SpeakerForm ( forms . ModelForm ) :
2014-07-30 18:19:26 +00:00
2017-04-24 12:50:48 +00:00
required_css_class = ' label-required '
2012-07-12 04:38:24 +00:00
class Meta :
model = Speaker
fields = [
" name " ,
2022-12-07 14:08:54 +00:00
" pronouns " ,
2012-07-12 04:38:24 +00:00
" biography " ,
2016-06-19 03:19:32 +00:00
" experience " ,
2023-04-23 23:06:36 +00:00
# "photo",
2022-12-07 14:08:54 +00:00
" telephone " ,
2023-04-20 01:54:36 +00:00
# "local_timezone",
2016-06-19 03:19:32 +00:00
" homepage " ,
2016-03-15 03:24:14 +00:00
" twitter_username " ,
2022-12-07 14:08:54 +00:00
" mastodon_username " ,
2016-06-18 03:53:02 +00:00
" accessibility " ,
2023-04-20 01:54:36 +00:00
# "travel_assistance",
# "accommodation_assistance",
# "assistance",
2016-06-19 04:00:17 +00:00
" agreement " ,
2012-07-12 04:38:24 +00:00
]
2016-03-15 03:24:14 +00:00
2016-06-19 04:00:17 +00:00
def __init__ ( self , * a , * * k ) :
super ( SpeakerForm , self ) . __init__ ( * a , * * k )
self . fields [ ' agreement ' ] . required = True
2023-04-21 10:30:29 +00:00
self . fields [ ' agreement ' ] . help_text = ' I agree to the <a href= " /attend/terms-and-conditions/ " >Terms and Conditions</a>, and I have read, understood, and agree to act according to the standards set forth in our <a href= " /attend/code-of-conduct/ " >Code of Conduct</a>.<br>I agree to the <a href= " /attend/health-and-safety/ " >Health and Safety Guidelines</a>, in particular the <strong>requirement to wear a mask</strong> at this event. '
2020-10-05 12:13:28 +00:00
self . fields [ ' biography ' ] . required = True
2023-04-20 01:54:36 +00:00
# self.fields['local_timezone'].required = True
2016-06-19 04:00:17 +00:00
2016-03-15 03:24:14 +00:00
def clean_twitter_username ( self ) :
value = self . cleaned_data [ " twitter_username " ]
if value . startswith ( " @ " ) :
value = value [ 1 : ]
return value