fix: use organisation name from answer set if set

Resolves #90
This commit is contained in:
James Graham
2021-03-05 12:21:39 +00:00
parent 8d68e1b0c3
commit 12bc9f886f
3 changed files with 4 additions and 3 deletions

View File

@@ -42,7 +42,8 @@ class Organisation(models.Model):
name = models.CharField(max_length=255, blank=False, null=False)
def __str__(self) -> str:
return self.name
# Prefer name as in latest OrganisationAnswerSet
return self.current_answers.name or self.name
@property
def current_answers(self) -> 'OrganisationAnswerSet':