ó
®â0_c           @   s2   d  d l  Z  d  d l m Z d „  Z d „  Z d S(   iÿÿÿÿN(   t   HttpRequestc             s   ‡  f d †  } | S(   s§  
    Indicates which variables used in the decorated function are sensitive, so
    that those variables can later be treated in a special way, for example
    by hiding them when logging unhandled exceptions.

    Two forms are accepted:

    * with specified variable names:

        @sensitive_variables('user', 'password', 'credit_card')
        def my_function(user):
            password = user.pass_word
            credit_card = user.credit_card_number
            ...

    * without any specified variable names, in which case it is assumed that
      all variables are considered sensitive:

        @sensitive_variables()
        def my_function()
            ...
    c            s(   t  j ˆ  ƒ ‡  ‡ ‡ f d †  ƒ ‰ ˆ S(   Nc             s(   ˆ r ˆ ˆ _  n	 d ˆ _  ˆ  |  | Ž  S(   Nt   __ALL__(   t   sensitive_variables(   t	   func_argst   func_kwargs(   t   funct   sensitive_variables_wrappert	   variables(    s?   /tmp/pip-unpacked-wheel-BAJOf3/django/views/decorators/debug.pyR      s    	(   t	   functoolst   wraps(   R   (   R   (   R   R   s?   /tmp/pip-unpacked-wheel-BAJOf3/django/views/decorators/debug.pyt	   decorator   s    $(    (   R   R
   (    (   R   s?   /tmp/pip-unpacked-wheel-BAJOf3/django/views/decorators/debug.pyR      s    	c             s   ‡  f d †  } | S(   s¨  
    Indicates which POST parameters used in the decorated view are sensitive,
    so that those parameters can later be treated in a special way, for example
    by hiding them when logging unhandled exceptions.

    Two forms are accepted:

    * with specified parameters:

        @sensitive_post_parameters('password', 'credit_card')
        def my_view(request):
            pw = request.POST['password']
            cc = request.POST['credit_card']
            ...

    * without any specified parameters, in which case it is assumed that
      all parameters are considered sensitive:

        @sensitive_post_parameters()
        def my_view(request)
            ...
    c            s%   t  j ˆ  ƒ ‡ ‡  f d †  ƒ } | S(   Nc            sF   t  |  t ƒ s t d ƒ ‚ ˆ  r- ˆ  |  _ n	 d |  _ ˆ |  | | Ž S(   Ns   sensitive_post_parameters didn't receive an HttpRequest. If you are decorating a classmethod, be sure to use @method_decorator.R   (   t
   isinstanceR    t   AssertionErrort   sensitive_post_parameters(   t   requestt   argst   kwargs(   t
   parameterst   view(    s?   /tmp/pip-unpacked-wheel-BAJOf3/django/views/decorators/debug.pyt!   sensitive_post_parameters_wrapperA   s    		(   R   R	   (   R   R   (   R   (   R   s?   /tmp/pip-unpacked-wheel-BAJOf3/django/views/decorators/debug.pyR
   @   s    !(    (   R   R
   (    (   R   s?   /tmp/pip-unpacked-wheel-BAJOf3/django/views/decorators/debug.pyR   )   s    (   R   t   django.httpR    R   R   (    (    (    s?   /tmp/pip-unpacked-wheel-BAJOf3/django/views/decorators/debug.pyt   <module>   s   	#