diff --git a/datacenterlight/views.py b/datacenterlight/views.py index 79439bf..4bc2a1d 100755 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -240,7 +240,7 @@ class PaymentOrderView(FormView): template_name = 'datacenterlight/landing_payment.html' def get_form_class(self): - if self.request.user.is_authenticated(): + if self.request.user.is_authenticated: return BillingAddressForm else: return BillingAddressFormSignup @@ -252,7 +252,7 @@ class PaymentOrderView(FormView): else: billing_address_data = {} - if self.request.user.is_authenticated(): + if self.request.user.is_authenticated: if billing_address_data: billing_address_form = BillingAddressForm( initial=billing_address_data diff --git a/hosting/forms.py b/hosting/forms.py index b9e1a0f..55599cd 100755 --- a/hosting/forms.py +++ b/hosting/forms.py @@ -218,7 +218,7 @@ class UserHostingKeyForm(forms.ModelForm): return self.data.get('name') def clean_user(self): - return self.request.user if self.request.user.is_authenticated() else None + return self.request.user if self.request.user.is_authenticated else None def clean(self): cleaned_data = self.cleaned_data diff --git a/hosting/views.py b/hosting/views.py index 316c4f9..c457535 100755 --- a/hosting/views.py +++ b/hosting/views.py @@ -284,7 +284,7 @@ class SignupView(HostingContextMixin, CreateView): @method_decorator(decorators) 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(SignupView, self).get(request, *args, **kwargs) @@ -361,7 +361,7 @@ class SignupValidatedView(SignupValidateView, HostingContextMixin): @method_decorator(decorators) def get(self, request, *args, **kwargs): - if self.request.user.is_authenticated(): + if self.request.user.is_authenticated: return HttpResponseRedirect(reverse_lazy('hosting:dashboard')) return super(SignupValidatedView, self).get(request, *args, **kwargs) diff --git a/utils/views.py b/utils/views.py index a780f5f..838f861 100755 --- a/utils/views.py +++ b/utils/views.py @@ -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,