#26480: Allow sensitive_variables() to preserve the signature of its decorated
function
---------------------------------+------------------------------------
     Reporter:  tpazderka        |                    Owner:  nobody
         Type:  New feature      |                   Status:  new
    Component:  Error reporting  |                  Version:  master
     Severity:  Normal           |               Resolution:
     Keywords:                   |             Triage Stage:  Accepted
    Has patch:  0                |      Needs documentation:  0
  Needs tests:  0                |  Patch needs improvement:  0
Easy pickings:  0                |                    UI/UX:  0
---------------------------------+------------------------------------

Comment (by vzima):

 What about something like this:

 {{{
 #!python
 def sensitive_variables(*variables):
     def decorator(func):
         @functools.wraps(func)
         def sensitive_variables_wrapper(*func_args, **func_kwargs):
             ...
         # Keep the original function for inspection in `authenticate`
         sensitive_variables_wrapper.sensitive_variables_func = func
         return sensitive_variables_wrapper
     return decorator
 }}}

 Function `authenticate` would then check the `sensitive_variables_func`
 first.

--
Ticket URL: <https://code.djangoproject.com/ticket/26480#comment:6>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.53154350ab694062acc73125bd1b264b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to