From 4129fb1a79f4082466940c3d0b0ced7767697664 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 2 Apr 2019 16:38:18 +0200 Subject: Tests: fix default conversion to str --- archaeological_finds/models_treatments.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'archaeological_finds/models_treatments.py') diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py index 572f002f2..996e03370 100644 --- a/archaeological_finds/models_treatments.py +++ b/archaeological_finds/models_treatments.py @@ -219,11 +219,7 @@ class Treatment(DashboardFormItem, ValueGetter, DocumentItem, ordering = ("-year", "-index", "-start_date") def __str__(self): - if self.cached_label: - return self.cached_label - self.skip_history_when_saving = True - self.save() - return self.cached_label + return self.cached_label or "" @property def short_class_name(self): @@ -994,7 +990,7 @@ class TreatmentFile(DashboardFormItem, ClosedItem, DocumentItem, ordering = ('cached_label',) def __str__(self): - return self.cached_label + return self.cached_label or "" @property def short_class_name(self): -- cgit v1.2.3