Small refactor so that RolesView doesn't query database twice
This commit is contained in:
parent
611a7abf95
commit
fa3eeec327
|
@ -419,12 +419,7 @@ class RolesView(AccessControl, SingleTableView):
|
||||||
if queryset is None:
|
if queryset is None:
|
||||||
self.object_list = self.model.objects.all()
|
self.object_list = self.model.objects.all()
|
||||||
|
|
||||||
context = super().get_context_data(**kwargs)
|
return super().get_context_data(**kwargs)
|
||||||
context.update({
|
|
||||||
'roles': Rol.objects,
|
|
||||||
})
|
|
||||||
|
|
||||||
return context
|
|
||||||
|
|
||||||
|
|
||||||
class RolRegisterView(AccessControl, CreateView):
|
class RolRegisterView(AccessControl, CreateView):
|
||||||
|
|
Loading…
Reference in New Issue