diff --git a/aleksis/core/util/predicates.py b/aleksis/core/util/predicates.py index fe84bf187f8f96ef4998ac96de8853048f203834..5f08199037734458192196f73b8ba82d0e116c55 100644 --- a/aleksis/core/util/predicates.py +++ b/aleksis/core/util/predicates.py @@ -63,10 +63,10 @@ def has_any_object(perm: str, klass): @predicate(name) def fn(user: User) -> bool: - try: - return get_objects_for_user(user, perm, klass).exists() - except: - return queryset_rules_filter(user, klass.objects.all(), perm).exists() + return ( + get_objects_for_user(user, perm, klass).exists() + or queryset_rules_filter(user, klass.objects.all(), perm).exists() + ) return fn