Skip to content
Snippets Groups Projects
Verified Commit 6e75338a authored by permcu's avatar permcu Committed by Jonathan Weth
Browse files

Return subject name instead of whole subject from backend

parent e819ee3b
No related branches found
No related tags found
1 merge request!373Resolve "Substitutions table for new data model"
......@@ -186,7 +186,8 @@ class SubstitutionType(graphene.ObjectType):
elif not le.amends.subject and not le.subject:
return le.amends.title
else:
return le.amends.subject or le.subject
subject = le.amends.subject or le.subject
return subject.short_name or subject.name
def resolve_new_subject(root, info):
le = root['REFERENCE_OBJECT']
......@@ -195,7 +196,7 @@ class SubstitutionType(graphene.ObjectType):
elif not le.amends.subject and not le.subject:
return le.title
elif le.subject and le.amends.subject:
return le.subject
return le.subject.short_name or le.subject.name
else:
return None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment