Added removed-redefinition-of-get_traceback_frame_variables.patch.
authorThomas Goirand <thomas@goirand.fr>
Mon, 11 Jan 2016 13:51:18 +0000 (13:51 +0000)
committerThomas Goirand <thomas@goirand.fr>
Mon, 11 Jan 2016 13:51:18 +0000 (13:51 +0000)
Rewritten-From: 0a1485933638433eff2291512d6f7a6d0dc3b0d6

trusty/debian/changelog
trusty/debian/patches/0150-removed-redefinition-of-get_traceback_frame_variables.patch [new file with mode: 0644]
trusty/debian/patches/series

index c06da759820d630d13a0b3657823a3c5d4ddbd28..3a86531b9741eb84c64a1a71bb005452070010fa 100644 (file)
@@ -11,6 +11,7 @@ horizon (2:8.0.0-4) unstable; urgency=medium
   * Added fix-request.REQUEST-does-not-exist.patch.
   * Added remove-load-url-from-future.patch.
   * Added fix-assertRedirects-no-longer-forced-absolute-URLs.patch.
+  * Added removed-redefinition-of-get_traceback_frame_variables.patch.
 
  -- Thomas Goirand <zigo@debian.org>  Mon, 11 Jan 2016 02:54:28 +0000
 
diff --git a/trusty/debian/patches/0150-removed-redefinition-of-get_traceback_frame_variables.patch b/trusty/debian/patches/0150-removed-redefinition-of-get_traceback_frame_variables.patch
new file mode 100644 (file)
index 0000000..ccda299
--- /dev/null
@@ -0,0 +1,67 @@
+Description: Removed redefinition of get_traceback_frame_variables
+ This code was part of fixes before Django 1.4 was released, and is no longer
+ necessary. In fact, it uses get_request_repr() which is not available in
+ Django 1.9 anymore, so it is necessary to remove it to avoid crashes.
+Author: Thomas Goirand <zigo@debian.org>
+Forwarded: no
+Last-Update: 2016-01-11
+
+--- horizon-8.0.0.orig/horizon/exceptions.py
++++ horizon-8.0.0/horizon/exceptions.py
+@@ -40,56 +40,6 @@ class HorizonReporterFilter(SafeExceptio
+     def is_active(self, request):
+         return True
+-    # TODO(gabriel): This bugfix is cribbed from Django's code. When 1.4.1
+-    # is available we can remove this code.
+-    def get_traceback_frame_variables(self, request, tb_frame):
+-        """Replaces the values of variables marked as sensitive with
+-        stars (*********).
+-        """
+-        # Loop through the frame's callers to see if the sensitive_variables
+-        # decorator was used.
+-        current_frame = tb_frame.f_back
+-        sensitive_variables = None
+-        while current_frame is not None:
+-            if (current_frame.f_code.co_name == 'sensitive_variables_wrapper'
+-                    and 'sensitive_variables_wrapper'
+-                    in current_frame.f_locals):
+-                # The sensitive_variables decorator was used, so we take note
+-                # of the sensitive variables' names.
+-                wrapper = current_frame.f_locals['sensitive_variables_wrapper']
+-                sensitive_variables = getattr(wrapper,
+-                                              'sensitive_variables',
+-                                              None)
+-                break
+-            current_frame = current_frame.f_back
+-
+-        cleansed = []
+-        if self.is_active(request) and sensitive_variables:
+-            if sensitive_variables == '__ALL__':
+-                # Cleanse all variables
+-                for name, value in tb_frame.f_locals.items():
+-                    cleansed.append((name, CLEANSED_SUBSTITUTE))
+-                return cleansed
+-            else:
+-                # Cleanse specified variables
+-                for name, value in tb_frame.f_locals.items():
+-                    if name in sensitive_variables:
+-                        value = CLEANSED_SUBSTITUTE
+-                    elif isinstance(value, HttpRequest):
+-                        # Cleanse the request's POST parameters.
+-                        value = self.get_request_repr(value)
+-                    cleansed.append((name, value))
+-                return cleansed
+-        else:
+-            # Potentially cleanse only the request if it's one of the
+-            # frame variables.
+-            for name, value in tb_frame.f_locals.items():
+-                if isinstance(value, HttpRequest):
+-                    # Cleanse the request's POST parameters.
+-                    value = self.get_request_repr(value)
+-                cleansed.append((name, value))
+-            return cleansed
+-
+ class HorizonException(Exception):
+     """Base exception class for distinguishing our own exception classes."""
index 07a9f6c6bd837665fccdc03af9e8b3b2284069ca..aab60c24c1a1d8fb56440a62894ee8d470fae8cd 100644 (file)
@@ -12,3 +12,4 @@
 0120-fix-request.REQUEST-does-not-exist.patch
 0130-remove-load-url-from-future.patch
 0140-fix-assertRedirects-no-longer-forced-absolute-URLs.patch
+0150-removed-redefinition-of-get_traceback_frame_variables.patch