Fix login for users with no school class
This commit is contained in:
parent
394469d773
commit
b3b02acfef
|
|
@ -56,6 +56,8 @@ class UserNode(DjangoObjectType):
|
|||
return self.is_teacher()
|
||||
|
||||
def resolve_school_classes(self, info):
|
||||
if self.selected_class() is None: # then we don't have any class to return
|
||||
return []
|
||||
return SchoolClass.objects.filter(
|
||||
Q(schoolclassmember__active=True, schoolclassmember__user=self) | Q(pk=self.selected_class().pk)).distinct()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue