示例#1
0
 def process_request(self, request):
     # django debug_toolbar
     if '__debug__' in request.path:
         return
     if self.is_safe(request.path):
         return
     path = u'/%s' % ('/'.join(request.path.split('/')[2:]),)
     if self.is_safe(path):
         return
     if request.user.is_authenticated():
         profile = get_profile_safely(request.user, True)
         print profile.name
         if profile.has_chosen_identifier:
             return
         return HttpResponseRedirect(reverse('users_edit'))
 def process_request(self, request):
     """
     if it's a request for the django debug toolbar AND we're in dev we can
     ignore - this check now only applies to when the site is in dev
     """
     if settings.DEBUG and '__debug__' in request.path:
         return
     if self.is_safe(request.path):
         return
     # remove the locale string - resolve won't work with it included
     path = u'/%s' % ('/'.join(request.path.split('/')[2:]),)
     if self.is_safe(path):
         return
     if request.user.is_authenticated():
         profile = get_profile_safely(request.user, True)
         if profile.has_chosen_identifier:
             return
         return HttpResponseRedirect(reverse('users_edit'))