From f9c406e5f7a1ea139ae91abbf21266bdbf9b5145 Mon Sep 17 00:00:00 2001 From: Sachi King Date: Sun, 26 Mar 2017 15:17:38 +1100 Subject: [PATCH] Remove 500 patch. 1.7.0 upgrade. While 1.7.0 exhibits a similar issue, we would need to re-verify and re-patch this library with a new 1.7.0 monkeypatch. This is ultimately only an annoyance. It only occours when we've already 500'd, and this just means we get a second 500. As such it's not critical. --- pinaxcon/monkey_patch.py | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/pinaxcon/monkey_patch.py b/pinaxcon/monkey_patch.py index dba6fe65..445430c6 100644 --- a/pinaxcon/monkey_patch.py +++ b/pinaxcon/monkey_patch.py @@ -11,7 +11,6 @@ class MonkeyPatchMiddleware(object): def do_monkey_patch(): patch_speaker_profile_form() - fix_sitetree_check_access_500s() patch_stripe_payment_form() # Remove this function from existence @@ -31,25 +30,6 @@ def patch_speaker_profile_form(): fields["accessibility"].widget = widgets.AceMarkdownEditor() -def fix_sitetree_check_access_500s(): - ''' django-sitetree has a bug: https://github.com/idlesign/django-sitetree/pull/167/files - -- it swallows the cause of all 500 errors. This swallows KeyErrors from - the failing function. ''' - - from sitetree.sitetreeapp import SiteTree - - old_check_access = SiteTree.check_access - - @wraps(SiteTree.check_access) - def check_access(self, *a, **k): - try: - return old_check_access(self, *a, **k) - except KeyError: - return False - - SiteTree.check_access = check_access - - def patch_stripe_payment_form(): # noqa: C901 import inspect # Oh no.