From 8c16a9dd6de2fa6ab4514e4117214a97f4f4cfeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89loi=20Rivard?= Date: Mon, 8 Apr 2024 10:50:37 +0200 Subject: [PATCH] fix: Lazy permission loading exception --- CHANGES.rst | 5 +++++ canaille/backends/models.py | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 04ca88b4..fd4998dd 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,8 @@ +Fixed +^^^^^ + +- Lazy permission loading exception. + [0.0.46] - 2024-04-08 --------------------- diff --git a/canaille/backends/models.py b/canaille/backends/models.py index 85cfd84f..dcf55936 100644 --- a/canaille/backends/models.py +++ b/canaille/backends/models.py @@ -181,8 +181,10 @@ class BackendModel: for attribute, value in filter.items(): attribute_type = self.get_attribute_type(attribute) - if not inspect.isclass(attribute_type) or not issubclass( - attribute_type, Model + if ( + isinstance(value, Model) + or not inspect.isclass(attribute_type) + or not issubclass(attribute_type, Model) ): continue