File tree Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Original file line number Diff line number Diff line change
1
+ from django .apps import AppConfig
2
+
3
+
4
+ class DjangocmsRestConfig (AppConfig ):
5
+ """
6
+ AppConfig for the djangocms_rest application.
7
+ This application provides RESTful APIs for Django CMS.
8
+ """
9
+ default_auto_field = "django.db.models.BigAutoField"
10
+ name = "djangocms_rest"
11
+ verbose_name = "Django CMS REST API"
12
+
13
+ def ready (self ):
14
+ try :
15
+ from djangocms_text import settings
16
+
17
+ settings .TEXT_INLINE_EDITING = False
18
+ except (ImportError , ModuleNotFoundError ):
19
+ pass
Original file line number Diff line number Diff line change @@ -115,9 +115,9 @@ def highlight_data(json_data: Any) -> str:
115
115
if json_data is None :
116
116
return '<span class="null">null</span>'
117
117
if isinstance (json_data , dict ):
118
- return OBJ_TEMPLATE . format ( ** highlight_json (json_data )) if json_data else '{}'
118
+ return highlight_json (json_data ). get ( "value" , "" ) if json_data else '{}'
119
119
if isinstance (json_data , list ):
120
- return OBJ_TEMPLATE . format ( ** highlight_list (json_data )) if json_data else '[]'
120
+ return highlight_list (json_data ). get ( "value" , "" ) if json_data else '[]'
121
121
122
122
return f'<span class="obj">{ json_data } </span>'
123
123
@@ -133,8 +133,8 @@ def highlight_json(
133
133
DETAILS_TEMPLATE .format (
134
134
key = escape (key ),
135
135
value = highlight_data (value ),
136
- open = '' ,
137
- close = '' ,
136
+ open = '{' if isinstance ( value , dict ) else '[ ' ,
137
+ close = '}' if isinstance ( value , dict ) else '] ' ,
138
138
) if isinstance (value , (dict , list )) and value else SIMPLE_TEMPLATE .format (
139
139
key = escape (key ),
140
140
value = highlight_data (value ),
You can’t perform that action at this time.
0 commit comments