diff options
Diffstat (limited to 'core/models.py')
-rw-r--r-- | core/models.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/models.py b/core/models.py index eb8428d..9fa7cec 100644 --- a/core/models.py +++ b/core/models.py @@ -112,8 +112,12 @@ class Expedition(TroggleModel): def get_expedition_day(self, date): expeditiondays = self.expeditionday_set.filter(date=date) if expeditiondays: - assert len(expeditiondays) == 1 - return expeditiondays[0] + if len(expeditiondays) == 1: + return expeditiondays[0] + else: + message ='! - more than one datum in an expeditionday: {}'.format(date) + DataIssue.objects.create(parser='expedition', message=message) + return expeditiondays[0] res = ExpeditionDay(expedition=self, date=date) res.save() return res |