def get(self, *args):
if self.request.user.is_anonymous:
return super(LoginUser, self).get(*args)
else:
return redirect('base')
def get(self, request, *args, **kwargs):
if self.request.user.is_anonymous:
context = {
'form_search': SearchForm(),
'form': LoginUserForm()
}
return render(request, 'Pay/registration/login.html', context)
else:
return redirect('base')