Fix is_supervisor returning true if user has any levels

Whoops!
This commit is contained in:
2022-01-02 11:15:03 +00:00
parent b73b8401b6
commit 046d0e461d
3 changed files with 3 additions and 3 deletions

View File

@@ -19,7 +19,7 @@ class Trainee(Profile, RevisionMixin):
@property
def is_supervisor(self):
return self.level_qualifications.all().exclude(confirmed_on=None).select_related('level') \
.filter(level__gte=TrainingLevel.SUPERVISOR) \
.filter(level__level__gte=TrainingLevel.SUPERVISOR) \
.exclude(level__department=TrainingLevel.HAULAGE) \
.exclude(level__department__isnull=True).exists()