diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-04-02 16:38:18 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-06-17 13:21:27 +0200 |
commit | 4129fb1a79f4082466940c3d0b0ced7767697664 (patch) | |
tree | c67ac8afe2228a572272dcebe8853d5d82bad9af /archaeological_finds/models_treatments.py | |
parent | aba701cfb26a9432cd306ba832a5357b0705ae01 (diff) | |
download | Ishtar-4129fb1a79f4082466940c3d0b0ced7767697664.tar.bz2 Ishtar-4129fb1a79f4082466940c3d0b0ced7767697664.zip |
Tests: fix default conversion to str
Diffstat (limited to 'archaeological_finds/models_treatments.py')
-rw-r--r-- | archaeological_finds/models_treatments.py | 8 |
1 files changed, 2 insertions, 6 deletions
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): |