Skip to content

Commit

Permalink
fix FieldResult.answer_display method so it works with multiple ans…
Browse files Browse the repository at this point in the history
…wers.
  • Loading branch information
Baltasar Sanchez committed Jul 31, 2015
1 parent a8699bd commit e68db46
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions formly/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,8 @@ def answer_value(self):
def answer_display(self):
val = self.answer_value()
if val and self.question.needs_choices:
if self.question.field_type == Field.CHECKBOX_FIELD:
return u", ".join([unicode(FieldChoice.objects.get(pk=int(v))) for v in val])
return FieldChoice.objects.get(pk=int(val))
return val

Expand Down

0 comments on commit e68db46

Please sign in to comment.