From 797da5b513bc2119ca275301efbe7790c8783f21 Mon Sep 17 00:00:00 2001 From: Django Doctor Date: Tue, 2 Feb 2021 07:48:27 +0000 Subject: [PATCH] Fix some django anti-patterns --- jet/dashboard/dashboard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jet/dashboard/dashboard.py b/jet/dashboard/dashboard.py index f7104bc4..66363747 100644 --- a/jet/dashboard/dashboard.py +++ b/jet/dashboard/dashboard.py @@ -137,7 +137,7 @@ def load_modules(self): user=self.context['request'].user.pk ).all() - if len(module_models) == 0: + if not module_models.exists(): module_models = self.create_initial_module_models(self.context['request'].user) loaded_modules = []