Commit 2d0edccd by Karsa Zoltán István

is_authenticated delete fun call

parent ae1c0a7d
...@@ -501,7 +501,7 @@ class RenewViewTest(unittest.TestCase): ...@@ -501,7 +501,7 @@ class RenewViewTest(unittest.TestCase):
inst._meta.object_name = "Instance" inst._meta.object_name = "Instance"
inst.renew = Instance._ops['renew'](inst) inst.renew = Instance._ops['renew'](inst)
inst.renew.async = MagicMock() inst.renew.async = MagicMock()
inst.has_level = lambda user, level: user.is_authenticated() inst.has_level = lambda user, level: user.is_authenticated
key = view.get_token_url(inst, user).split('?')[1].split('=')[1] key = view.get_token_url(inst, user).split('?')[1].split('=')[1]
request = FakeRequestFactory(GET={'k': key}, authenticated=False) request = FakeRequestFactory(GET={'k': key}, authenticated=False)
......
...@@ -251,7 +251,7 @@ class UnsubscribeFormView(SuccessMessageMixin, UpdateView): ...@@ -251,7 +251,7 @@ class UnsubscribeFormView(SuccessMessageMixin, UpdateView):
success_message = _("Successfully modified subscription.") success_message = _("Successfully modified subscription.")
def get_success_url(self): def get_success_url(self):
if self.request.user.is_authenticated(): if self.request.user.is_authenticated:
return super(UnsubscribeFormView, self).get_success_url() return super(UnsubscribeFormView, self).get_success_url()
else: else:
return self.request.path return self.request.path
......
...@@ -76,7 +76,7 @@ class RedirectToLoginMixin(AccessMixin): ...@@ -76,7 +76,7 @@ class RedirectToLoginMixin(AccessMixin):
return super(RedirectToLoginMixin, self).dispatch( return super(RedirectToLoginMixin, self).dispatch(
request, *args, **kwargs) request, *args, **kwargs)
except self.redirect_exception_classes: except self.redirect_exception_classes:
if not request.user.is_authenticated(): if not request.user.is_authenticated:
return redirect_to_login(request.get_full_path(), return redirect_to_login(request.get_full_path(),
self.get_login_url(), self.get_login_url(),
self.get_redirect_field_name()) self.get_redirect_field_name())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment