From 8d2d80c30e6a666242f98267cb43dc6922dd8c64 Mon Sep 17 00:00:00 2001 From: moanos Date: Thu, 21 Nov 2024 20:37:38 +0100 Subject: [PATCH] feat: Add intersex option for animals, fix bug --- src/fellchensammlung/models.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/fellchensammlung/models.py b/src/fellchensammlung/models.py index e3fc1b2..4105422 100644 --- a/src/fellchensammlung/models.py +++ b/src/fellchensammlung/models.py @@ -244,11 +244,14 @@ class AdoptionNotice(models.Model): return sexes def sex_code(self): + # Treat Intersex as mixed in order to increase their visibility if len(self.sexes) > 1: return "mixed" - elif self.sexes.pop() == SexChoices.MALE: + + sex = self.sexes.pop() + if sex == SexChoices.MALE: return "male" - elif self.sexes.pop() == SexChoices.FEMALE: + elif sex == SexChoices.FEMALE: return "female" else: return "mixed"