mirror of
https://github.com/Southampton-RSG/breccia-mapper.git
synced 2026-03-03 11:27:09 +00:00
fix: error when viewing profile with no answerset
This commit is contained in:
@@ -114,9 +114,14 @@ class OrganisationDetailView(LoginRequiredMixin, DetailView):
|
||||
questions = questions.filter(answer_is_public=True)
|
||||
|
||||
question_answers = {}
|
||||
for question in questions:
|
||||
answers = answer_set.question_answers.filter(question=question)
|
||||
question_answers[str(question)] = ', '.join(map(str, answers))
|
||||
try:
|
||||
for question in questions:
|
||||
answers = answer_set.question_answers.filter(question=question)
|
||||
question_answers[str(question)] = ', '.join(map(str, answers))
|
||||
|
||||
except AttributeError:
|
||||
# No AnswerSet yet
|
||||
pass
|
||||
|
||||
return question_answers
|
||||
|
||||
|
||||
Reference in New Issue
Block a user