diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-06-29 15:37:18 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-02-28 12:15:20 +0100 |
commit | a8578dcee5b4cad64ec6e10b1dc5cbfad815b4c8 (patch) | |
tree | d915605d6207355788d69ad9a8e2a3a35d94507d /archaeological_finds | |
parent | 1d6484bfe6bbdf763f6a9c583115c1c6b3914037 (diff) | |
download | Ishtar-a8578dcee5b4cad64ec6e10b1dc5cbfad815b4c8.tar.bz2 Ishtar-a8578dcee5b4cad64ec6e10b1dc5cbfad815b4c8.zip |
Container - bulk update: remove parent when changing warehouse (refs #4959)
Diffstat (limited to 'archaeological_finds')
-rw-r--r-- | archaeological_finds/models_finds.py | 3 | ||||
-rw-r--r-- | archaeological_finds/tests.py | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index c83e78eaa..3adaf90dd 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -2220,7 +2220,8 @@ class Find(BulkUpdatedItem, ValueGetter, DocumentItem, BaseHistorizedItem, container = self.container if not container: return "" - locas = container.get_localisations() + ## first localisation is the warehouse + locas = list(container.get_localisations())[1:] if len(locas) < (place + 1): return "" return locas[place] diff --git a/archaeological_finds/tests.py b/archaeological_finds/tests.py index 80202f442..9387840a0 100644 --- a/archaeological_finds/tests.py +++ b/archaeological_finds/tests.py @@ -1930,7 +1930,7 @@ class TreatmentTest(FindInit, TestCase): self.create_finds(data_base={"label": u"Find 1"}, force=True) self.create_finds(data_base={"label": u"Find 2"}, force=True) image = Document.objects.create(title="Image!") - image.image.save('ishtar-bg.jpg', File(open(img))) + image.image.save('ishtar-bg.jpg', File(open(img, "rb"))) self.finds[0].documents.add(image) self.finds[0].save() |