diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-11-22 01:01:15 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-07-08 09:58:49 +0200 |
commit | e832c91be1b5f705412ec46528ed4d363cf384c3 (patch) | |
tree | 6a852fc6c6bbaf50712b59f536d5ba5e80310a5e /archaeological_finds/forms.py | |
parent | 208f027104efe94c9950cb83260570bf92f15097 (diff) | |
download | Ishtar-e832c91be1b5f705412ec46528ed4d363cf384c3.tar.bz2 Ishtar-e832c91be1b5f705412ec46528ed4d363cf384c3.zip |
Quick edit basket form: fix confirmation value for "shared with" and "share write with" (refs #5180)
Diffstat (limited to 'archaeological_finds/forms.py')
-rw-r--r-- | archaeological_finds/forms.py | 18 |
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") |