From 49be6089b2354a71372dfaf71612de08d67986ff Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 18 Oct 2018 11:50:20 +0200 Subject: Fix access to sheet and permission check for owns --- ishtar_common/backend.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'ishtar_common/backend.py') diff --git a/ishtar_common/backend.py b/ishtar_common/backend.py index 261e4dc6f..d5e092fa5 100644 --- a/ishtar_common/backend.py +++ b/ishtar_common/backend.py @@ -55,10 +55,9 @@ class ObjectPermBackend(ModelBackend): if obj is None: model_name = perm.split('_')[-1].lower() model = None - for app in apps.get_apps(): - for modl in apps.get_models(app): - if modl.__name__.lower() == model_name: - model = modl + for modl in apps.get_models(): + if modl.__name__.lower() == model_name: + model = modl if not model: return False return not is_ownperm or model.has_item_of(ishtar_user) -- cgit v1.2.3