Skip to content

Commit

Permalink
Handle error when division_suffix is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
VirginiaDooley committed Jul 3, 2024
1 parent ddc8fad commit ef89ffb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion wcivf/apps/elections/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,10 @@ def pluralized_division_name(self):
"parish": "parishes",
"constituency": "constituencies",
}
suffix = self.post_set.first().division_suffix
try:
suffix = self.post_set.first().division_suffix
except AttributeError:
suffix = None

if not suffix:
return "posts"
Expand Down

0 comments on commit ef89ffb

Please sign in to comment.