From ebb67ddbc918ca0e2c4f3082a45bb7f12ecb21eb Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 11 Dec 2024 15:11:02 +0100 Subject: 🐛 fix get own function for biographical notes (old behaviour) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ishtar_common/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ishtar_common/models.py') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index dc3c5d29a..4958011ec 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -3740,7 +3740,9 @@ class UserProfile(models.Model): # print(f"WARNING: no permission request for content {content_type.name} and profile {self}") # print("Using old behaviour") model_class = content_type.model_class() - query = model_class.get_owns(user=ishtar_user, query=True, no_auth_check=True) + query = None + if hasattr(model_class, "get_owns"): + query = model_class.get_owns(user=ishtar_user, query=True, no_auth_check=True) if query: item_ids = list( model_class.objects.filter(query).values_list("pk", flat=True) -- cgit v1.2.3