def get(self, request, *args, **kwargs):
   f = RegisterForm({'token': request.session['registration_token']})
   if f.is_valid():
     meta = request.session.get('request_meta', {})
     if 'HTTP_AUTHNID' in meta and 'HTTP_AUTHENTICATOR' in meta:
       token = f.cleaned_data['token']
       invitee = {
         'eppn': meta.get('HTTP_AUTHNID', None),
         'auth_method': meta.get('HTTP_AUTHENTICATOR', None),
       }
       if token.register(token.user, **invitee):
         return HttpResponseRedirect(self.success_url)
   return HttpResponseRedirect(force_text(self.failed_url))
 def get(self, request, *args, **kwargs):
   if 'token' in kwargs:
     form = RegisterForm({'token': kwargs['token']})
     if form.is_valid():
       return self.form_valid(form)
   return super(RegisterTokenView, self).get(request, *args, **kwargs)