File tree 3 files changed +27
-0
lines changed
3 files changed +27
-0
lines changed Original file line number Diff line number Diff line change
1
+ from django .apps import AppConfig
2
+ from sphinx .locale import _TranslationProxy
3
+ from sphinxcontrib .serializinghtml import jsonimpl
4
+
5
+
6
+ class FixedSphinxJSONEncoder (jsonimpl .SphinxJSONEncoder ):
7
+ def default (self , obj ):
8
+ if isinstance (obj , _TranslationProxy ):
9
+ return str (obj )
10
+ return super ().default (obj )
11
+
12
+
13
+ class SphinxBugWorkaroundConfig (AppConfig ):
14
+ """
15
+ Add a workaround for sphinx bug https://github.com/sphinx-doc/sphinx/issues/13448
16
+ """
17
+
18
+ name = "_sphinx_13448_workaround"
19
+ verbose_name = "Sphinx Bug 13448 Workaround"
20
+
21
+ def ready (self ):
22
+ from sphinx .domains import python # noqa: F401
23
+
24
+ jsonimpl .SphinxJSONEncoder = FixedSphinxJSONEncoder
Original file line number Diff line number Diff line change 89
89
"django.contrib.sitemaps" ,
90
90
"django_push.subscriber" ,
91
91
"django_read_only" ,
92
+ # Temporary fix for Sphinx bug.https://github.com/sphinx-doc/sphinx/issues/13448
93
+ # Can be removed (and code deleted) once fixed.
94
+ "_sphinx_13448_workaround" ,
92
95
]
93
96
94
97
LANGUAGE_CODE = "en-us"
You can’t perform that action at this time.
0 commit comments