summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2021-11-22 01:01:15 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2021-11-22 01:01:15 +0100
commit466786505c45b1993b303a09c76386254b21b388 (patch)
tree815bcf68436c122d9f189b7315de16c7b2fc86f4
parentd14087709e3be22f718ce4c1b161d98f55211802 (diff)
downloadIshtar-466786505c45b1993b303a09c76386254b21b388.tar.bz2
Ishtar-466786505c45b1993b303a09c76386254b21b388.zip
Quick edit basket form: fix confirmation value for "shared with" and "share write with" (refs #5180)
-rw-r--r--archaeological_finds/forms.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/archaeological_finds/forms.py b/archaeological_finds/forms.py
index 78086e60d..8337cbcf8 100644
--- a/archaeological_finds/forms.py
+++ b/archaeological_finds/forms.py
@@ -1142,6 +1142,24 @@ class QAFindBasketModify(QAForm):
"qa_public",
]
+ def _get_ishtar_user_list(self, value):
+ if not isinstance(value, list):
+ value = [value]
+ values = []
+ for v in value:
+ try:
+ values.append(str(IshtarUser.objects.get(pk=v)))
+ except IshtarUser.DoesNotExist:
+ pass
+ return " ; ".join(values)
+
+ def _get_qa_shared_with(self, value):
+ return self._get_ishtar_user_list(value)
+
+ def _get_qa_shared_write_with(self, value):
+ return self._get_ishtar_user_list(value)
+
+
class PreservationForm(CustomForm, ManageOldType):
form_label = _("Preservation")
form_admin_name = _("Find - 030 - Preservation")