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.
This commit is contained in:
		
							parent
							
								
									9e851c31fa
								
							
						
					
					
						commit
						f9c406e5f7
					
				
					 1 changed files with 0 additions and 20 deletions
				
			
		|  | @ -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. | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Sachi King
						Sachi King