Skip to content

Commit 20cc15a

Browse files
committed
Do not return null fields from templates
1 parent 9a39dc8 commit 20cc15a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

apps/apis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def getTemplates(self, request, slug=None):
235235
if slug:
236236
object = get_app_template_by_slug(slug)
237237
if object:
238-
object_dict = object.dict()
238+
object_dict = object.dict(exclude_none=True)
239239
# For backward compatibility with old app templates
240240
for page in object_dict['pages']:
241241
page['schema'] = page['input_schema']

apps/serializers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def get_template(self, obj):
211211
elif obj.template_slug is not None:
212212
app_template = get_app_template_by_slug(obj.template_slug)
213213
if app_template:
214-
return app_template.dict()
214+
return app_template.dict(exclude_none=True)
215215
return None
216216

217217
def get_web_config(self, obj):

0 commit comments

Comments
 (0)