summaryrefslogtreecommitdiff
path: root/ishtar_common/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/utils.py')
-rw-r--r--ishtar_common/utils.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/ishtar_common/utils.py b/ishtar_common/utils.py
index 8de745874..09c470823 100644
--- a/ishtar_common/utils.py
+++ b/ishtar_common/utils.py
@@ -395,7 +395,8 @@ class OwnPerms:
"""
Check if the current object is owned by the user
"""
- print("ishtar_common/utils.py - 370 - DELETE")
+ print("ishtar_common/utils.py - 377 - DELETE")
+ raise
IshtarUser = apps.get_model("ishtar_common", "IshtarUser")
if isinstance(user, IshtarUser):
ishtaruser = user
@@ -467,13 +468,18 @@ class OwnPerms:
values=None,
get_short_menu_class=False,
menu_filtr=None,
+ no_auth_check=False,
+ query=False
):
"""
Get Own items
"""
+ return_query = query
+ query = None
if not replace_query:
replace_query = {}
- if hasattr(user, "is_authenticated") and not user.is_authenticated:
+ if hasattr(user, "is_authenticated") and not user.is_authenticated \
+ and not no_auth_check:
returned = cls.objects.filter(pk__isnull=True)
if values:
returned = []
@@ -502,6 +508,10 @@ class OwnPerms:
if values:
returned = []
return returned
+ if return_query:
+ if query:
+ return query
+ return replace_query
if query:
q = cls.objects.filter(query)
else: # replace_query