From 67c92cbbd528180be6e35717297391e891d1540c Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 9 Sep 2016 20:39:08 +0200 Subject: Fix tests with bad initialization --- archaeological_finds/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'archaeological_finds/models.py') diff --git a/archaeological_finds/models.py b/archaeological_finds/models.py index 603e046ee..5811ded6e 100644 --- a/archaeological_finds/models.py +++ b/archaeological_finds/models.py @@ -450,8 +450,8 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): @property def administrative_index(self): bf = self.get_first_base_find() - if not bf: - return + if not bf or not bf.context_record or not bf.context_record.operation: + return "" return "{}-{}".format( bf.context_record.operation.get_reference(), self.index) -- cgit v1.2.3