Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 1 commit
  • 1 file changed
  • 0 comments
  • 1 contributor
May 24, 2012
Gabriel Hurley Fixed #18379 -- Support methods with sensitive_variables.
Adds checking to the get_traceback_frame_variables method of
SafeExceptionReporterFilter to support methods as well as
functions in the global namespace.
33292b7

Showing 1 changed file with 3 additions and 0 deletions. Show diff stats Hide diff stats

  1. 3  django/views/debug.py
3  django/views/debug.py
@@ -157,6 +157,9 @@ def get_traceback_frame_variables(self, request, tb_frame):
157 157
         """
158 158
         func_name = tb_frame.f_code.co_name
159 159
         func = tb_frame.f_globals.get(func_name)
  160
+        # Methods won't be in the global namespace, func could be None here...
  161
+        if func is None and "self" in tb_frame.f_locals:
  162
+            func = getattr(tb_frame.f_locals.get('self'), func_name, None)
160 163
         sensitive_variables = getattr(func, 'sensitive_variables', [])
161 164
         cleansed = []
162 165
         if self.is_active(request) and sensitive_variables:

No commit comments for this range

Something went wrong with that request. Please try again.