File: 0001-Fix-render_html-on-Django-2.2.patch

package info (click to toggle)
social-auth-app-django 3.1.0-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 324 kB
  • sloc: python: 1,482; makefile: 26
file content (28 lines) | stat: -rw-r--r-- 977 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From f8d674d9ac2da7683ff902a58d514ea5d1eb5b7b Mon Sep 17 00:00:00 2001
From: John Vandenberg <jayvdb@gmail.com>
Date: Wed, 10 Apr 2019 20:08:38 +0700
Subject: Fix render_html on Django 2.2

Update render_html to also catch TypeError.

Fixes https://github.com/python-social-auth/social-app-django/issues/196
---
 social_django/strategy.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/social_django/strategy.py b/social_django/strategy.py
index 1a3a820..b706afb 100644
--- a/social_django/strategy.py
+++ b/social_django/strategy.py
@@ -97,7 +97,7 @@ class DjangoStrategy(BaseStrategy):
         try:
             template = loader.get_template(tpl)
             return template.render(context=context, request=self.request)
-        except TemplateDoesNotExist:
+        except (TypeError, TemplateDoesNotExist):
             return render_template_string(self.request, html, context)
 
     def authenticate(self, backend, *args, **kwargs):
-- 
2.20.1