error fixes plus new coachoffer attribute
This commit is contained in:
@@ -706,6 +706,7 @@ class Rower(models.Model):
|
||||
clubsize = models.IntegerField(default=0)
|
||||
protrialexpires = models.DateField(default=datetime.date(1970,1,1))
|
||||
plantrialexpires = models.DateField(default=datetime.date(1970,1,1))
|
||||
offercoaching = models.BooleanField(default=False, verbose_name='Offer Remote Coaching')
|
||||
|
||||
|
||||
# Privacy Data
|
||||
@@ -3186,7 +3187,8 @@ class AccountRowerForm(ModelForm):
|
||||
'getemailnotifications',
|
||||
'getimportantemails',
|
||||
'defaulttimezone','showfavoritechartnotes',
|
||||
'defaultlandingpage']
|
||||
'defaultlandingpage',
|
||||
'offercoaching']
|
||||
|
||||
widgets = {
|
||||
'birthdate': SelectDateWidget(
|
||||
@@ -3194,6 +3196,10 @@ class AccountRowerForm(ModelForm):
|
||||
timezone.now().year-100,timezone.now().year-10)),
|
||||
}
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(AccountRowerForm, self).__init__(*args, **kwargs)
|
||||
if self.instance.rowerplan != 'coach':
|
||||
self.fields.pop('offercoaching')
|
||||
|
||||
def clean_email(self):
|
||||
email = self.cleaned_data.get('email')
|
||||
|
||||
Reference in New Issue
Block a user