Skip to content
Browse files

Fix use of json indent.

Simplejson took the characters to indent with, json takes the number of
spaces.
  • Loading branch information...
1 parent bcf4ea9 commit 9f9c3813fb6206ed441623c32aed60a76adfa2ca @tghw tghw committed Nov 18, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 app/models.py
View
4 app/models.py
@@ -200,7 +200,7 @@ def styles_json(self):
# response, we'll want to wrap it to avoid the exploit described at
# http://haacked.com/archive/2009/06/25/json-hijacking.aspx
styles_obj = [style.json_obj() for style in self.styles]
- return json.dumps(styles_obj, default=dt_handler, sort_keys=True, indent=4*' ' if settings.debug else None)
+ return json.dumps(styles_obj, default=dt_handler, sort_keys=True, indent=4 if settings.debug else None)
def upload_to_cdn(self):
if not settings.use_google_cloud_storage:
@@ -370,7 +370,7 @@ def is_stale(self):
def send_message(self, message):
if not isinstance(message, basestring):
- message = json.dumps(message, default=dt_handler, sort_keys=True, indent=4*' ' if settings.debug else None)
+ message = json.dumps(message, default=dt_handler, sort_keys=True, indent=4 if settings.debug else None)
gae_channels.send_message(self.client_id, message)
@staticmethod

0 comments on commit 9f9c381

Please sign in to comment.
Something went wrong with that request. Please try again.