Use user.is_authenticated bool field instead of method call

This commit is contained in:
M.Ravi 2023-12-06 20:41:49 +05:30
commit d3abf02912
4 changed files with 7 additions and 7 deletions

View file

@ -69,7 +69,7 @@ class LoginViewMixin(FormView):
@cache_control(no_cache=True, must_revalidate=True, no_store=True)
def get(self, request, *args, **kwargs):
if self.request.user.is_authenticated():
if self.request.user.is_authenticated:
return HttpResponseRedirect(self.get_success_url())
return super(LoginViewMixin, self).get(request, *args, **kwargs)
@ -225,7 +225,7 @@ class SSHKeyCreateView(FormView):
'form': UserHostingKeyForm(request=self.request),
})
if self.request.user.is_authenticated():
if self.request.user.is_authenticated:
owner = self.request.user
manager = OpenNebulaManager(
email=owner.username,