def _get_val():
     token = get_token(request)
     if token is None:
         # In order to be able to provide debugging info in the
         # case of misconfiguration, we use a sentinel value
         # instead of returning an empty dict.
         return 'NOTPROVIDED'
     else:
         return smart_text(token)
Beispiel #2
0
 def process_view(self, request, callback, callback_args, callback_kwargs):
     retval = super(_EnsureCsrfCookie, self).process_view(request, callback, callback_args, callback_kwargs)
     # Forces process_response to send the cookie
     get_token(request)
     return retval