Как использовать if в представлении на основе классов в django
я хочу использовать if и мне нужно иметь переменную и эта переменная должна иметь kwords
class ResetPassword(FormView):
template_name = 'reset_password.html'
form_class = ResetPasswordForm
def get_context_data(self, **kwargs):
context = super(ResetPassword, self).get_context_data(**kwargs)
context['uuid'] = kwargs.get('uuid')
context['base64'] = kwargs.get('base64')
return context
if (get_context_data['context']['uuid'] and get_context_data['context']['base64']) == (url_uuid and url_base64):
def form_valid(self, form):
user = User.objects.get(id= self.request.user.id)
user.set_password(form.cleaned_data['password'])
user.save()
return redirect('/login')