Validate that only supervisors may be supervisors

This commit is contained in:
2021-08-19 16:19:46 +01:00
parent 8b48b02ca7
commit 9590c2066d
3 changed files with 8 additions and 5 deletions

View File

@@ -10,6 +10,7 @@ class Trainee(Profile):
@property
def is_supervisor(self):
# FIXME Efficiency
for level_qualification in self.levels.select_related('level').all():
if confirmed_on is not None and level_qualification.level.level >= TrainingLevel.SUPERVISOR:
return True