Fix bug in role retrieval
This commit is contained in:
parent
b1e44ef263
commit
6f15ac4173
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Reference in New Issue