Fix bug in role retrieval

This commit is contained in:
Ramon Wenger 2018-10-08 14:35:57 +02:00
parent b1e44ef263
commit 6f15ac4173
1 changed files with 2 additions and 1 deletions

View File

@ -29,7 +29,8 @@ class UserNode(DjangoObjectType):
# todo: wayyyy to complicated, do we need such a sophisticated role system?
def resolve_role(self, info, **kwargs):
return self.userschoolrole_set.first().school_role.key
role = self.userschoolrole_set.first()
return role.school_role.key if role is not None else 'student'
class SchoolClassNode(DjangoObjectType):