From fa3eeec32767cdf30f0946ddee45bd80d0265273 Mon Sep 17 00:00:00 2001 From: Elijah Date: Fri, 1 Dec 2023 10:29:32 +0100 Subject: [PATCH] Small refactor so that RolesView doesn't query database twice --- idhub/admin/views.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/idhub/admin/views.py b/idhub/admin/views.py index 93e93f8..bc93abe 100644 --- a/idhub/admin/views.py +++ b/idhub/admin/views.py @@ -419,12 +419,7 @@ class RolesView(AccessControl, SingleTableView): if queryset is None: self.object_list = self.model.objects.all() - context = super().get_context_data(**kwargs) - context.update({ - 'roles': Rol.objects, - }) - - return context + return super().get_context_data(**kwargs) class RolRegisterView(AccessControl, CreateView):