Private
Public Access
1
0
This commit is contained in:
Sander Roosendaal
2019-10-19 15:33:04 +02:00
parent 45666d22a7
commit 8f2e0356d1

View File

@@ -1418,10 +1418,12 @@ class TrainingPlan(models.Model):
def save(self, *args, **kwargs):
manager = self.manager
if manager.rowerplan in ['basic','pro']:
raise ValidationError(
"Basic user cannot have a training plan"
)
if manager.plantrialexpires < timezone.now().date():
raise ValidationError(
"Basic user cannot have a training plan"
)
if self.enddate < self.startdate:
startdate = self.startdate