def form_valid(self, form):
response = self.ulogin_response(form.cleaned_data['<STR_LIT>'],<EOL>self.request.get_host())<EOL>if '<STR_LIT:error>' in response:<EOL><INDENT>return render(self.request, self.error_template_name,<EOL>{'<STR_LIT>': response})<EOL><DEDENT>if user_is_authenticated(get_user(self.request)):<EOL><INDENT>user, identity, registered =self.handle_authenticated_user(response)<EOL><DEDENT>else:<EOL><INDENT>user, identity, registered =self.handle_anonymous_user(response)<EOL><DEDENT>assign.send(sender=ULoginUser,<EOL>user=get_user(self.request),<EOL>request=self.request,<EOL>registered=registered,<EOL>ulogin_user=identity,<EOL>ulogin_data=response)<EOL>return redirect(self.request.GET.get(REDIRECT_FIELD_NAME) or '<STR_LIT:/>')<EOL>
The request from ulogin service is correct