Use title inside of survey data instead of admin title for user display
Resolves MS-905 #complete
This commit is contained in:
parent
1ad482c651
commit
446f6ad563
|
|
@ -44,6 +44,15 @@ class SurveyNode(DjangoObjectType):
|
|||
def resolve_path(root: Survey, info, **kwargs):
|
||||
return root.route
|
||||
|
||||
@staticmethod
|
||||
def resolve_title(root: Survey, info, **kwargs):
|
||||
try:
|
||||
pages = root.data["pages"]
|
||||
title = pages[0]["title"]
|
||||
return title
|
||||
except KeyError:
|
||||
return root.title
|
||||
|
||||
|
||||
class SurveysQuery(object):
|
||||
survey = graphene.Field(SurveyNode, id=graphene.ID())
|
||||
|
|
|
|||
Loading…
Reference in New Issue