From 594c025a3f66c699f4b2a7add12781b7b6ad03e7 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 25 Sep 2023 19:04:37 +0200 Subject: 🐛 Federation: instead of deleting excluded fields, set them to null - distant sheets: add missing default permission check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog/en/changelog_2022-06-15.md | 8 ++++++++ changelog/fr/changelog_2023-01-25.md | 8 ++++++++ ishtar_common/models_common.py | 6 ++++-- ishtar_common/views_item.py | 2 ++ 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/changelog/en/changelog_2022-06-15.md b/changelog/en/changelog_2022-06-15.md index 0fe38c7e5..e4f2b2631 100644 --- a/changelog/en/changelog_2022-06-15.md +++ b/changelog/en/changelog_2022-06-15.md @@ -1,3 +1,11 @@ +v4.0.58 - 2023-09-25 +-------------------- + +### Bug fixes ### +- Federation: + - instead of deleting excluded fields, set them to null + - distant sheets: add missing default permission check + v4.0.57 - 2023-09-13 -------------------- diff --git a/changelog/fr/changelog_2023-01-25.md b/changelog/fr/changelog_2023-01-25.md index 8010316c5..aff53f878 100644 --- a/changelog/fr/changelog_2023-01-25.md +++ b/changelog/fr/changelog_2023-01-25.md @@ -1,3 +1,11 @@ +v4.0.58 - 2023-09-25 +-------------------- + +### Corrections de dysfonctionnements ### +- FĂ©dĂ©ration : + - au lieu de supprimer les champs exclus, leur attribuer la valeur vide + - fiches distances : ajout de permissions par dĂ©faut manquantes + v4.0.57 - 2023-09-13 -------------------- diff --git a/ishtar_common/models_common.py b/ishtar_common/models_common.py index 83245f0ff..4ab97cf58 100644 --- a/ishtar_common/models_common.py +++ b/ishtar_common/models_common.py @@ -3154,9 +3154,11 @@ class SerializeItem: for field in self._meta.get_fields(): field_name = field.name - if field_name in self.SERIALIZE_EXCLUDE or field_name in exclude: + if field_name in self.SERIALIZE_EXCLUDE: continue - if field.many_to_one or field.one_to_one: + elif field_name in exclude: + full_result[field_name] = "" + elif field.many_to_one or field.one_to_one: try: value = getattr(self, field_name) except (MultipleObjectsReturned, ObjectDoesNotExist): diff --git a/ishtar_common/views_item.py b/ishtar_common/views_item.py index 70ae0f2d0..eba83275e 100644 --- a/ishtar_common/views_item.py +++ b/ishtar_common/views_item.py @@ -330,6 +330,8 @@ def show_source_item(request, source_id, model, name, base_dct, extra_dct): permissions = ["permission_view_document"] for p in permissions: dct[p] = True + dct["permission_change_own_document"] = False + dct["permission_change_document"] = False tpl = loader.get_template(f"ishtar/sheet_{name}_window.html") content = tpl.render(dct, request) -- cgit v1.2.3