~ubuntu-branches/ubuntu/saucy/python-django/saucy-updates

« back to all changes in this revision

Viewing changes to django/views/decorators/debug.py

  • Committer: Package Import Robot
  • Author(s): Raphaël Hertzog
  • Date: 2012-08-02 10:44:02 UTC
  • mfrom: (1.2.13)
  • mto: This revision was merged to the branch mainline in revision 39.
  • Revision ID: package-import@ubuntu.com-20120802104402-pc04sj64wnrf4348
Tags: upstream-1.4.1
Import upstream version 1.4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
    """
27
27
    def decorator(func):
28
28
        @functools.wraps(func)
29
 
        def wrapper(*args, **kwargs):
 
29
        def sensitive_variables_wrapper(*args, **kwargs):
30
30
            if variables:
31
 
                wrapper.sensitive_variables = variables
 
31
                sensitive_variables_wrapper.sensitive_variables = variables
32
32
            else:
33
 
                wrapper.sensitive_variables = '__ALL__'
 
33
                sensitive_variables_wrapper.sensitive_variables = '__ALL__'
34
34
            return func(*args, **kwargs)
35
 
        return wrapper
 
35
        return sensitive_variables_wrapper
36
36
    return decorator
37
37
 
38
38
 
61
61
    """
62
62
    def decorator(view):
63
63
        @functools.wraps(view)
64
 
        def wrapper(request, *args, **kwargs):
 
64
        def sensitive_post_parameters_wrapper(request, *args, **kwargs):
65
65
            if parameters:
66
66
                request.sensitive_post_parameters = parameters
67
67
            else:
68
68
                request.sensitive_post_parameters = '__ALL__'
69
69
            return view(request, *args, **kwargs)
70
 
        return wrapper
 
70
        return sensitive_post_parameters_wrapper
71
71
    return decorator