Barry Warsaw pushed to branch release-3.0 at mailman / Mailman
Commits: adea7772 by Aurélien Bompard at 2015-11-21T12:08:32Z Sort the JSON keys in dev mode This makes it much easier to compare VCR tapes. - - - - - 5c996b43 by Barry Warsaw at 2015-11-21T12:09:45Z Sort the JSON output when [devmode]enabled is true. - - - - - 2 changed files: - src/mailman/docs/NEWS.rst - src/mailman/rest/helpers.py Changes: ===================================== src/mailman/docs/NEWS.rst ===================================== --- a/src/mailman/docs/NEWS.rst +++ b/src/mailman/docs/NEWS.rst @@ -58,6 +58,8 @@ Bugs Aurélien Bompard. (Closes: #154) * Fix ``UnicodeEncodeError`` in the hold chain when sending the authorization email to the mailing list moderators. (Closes: #144) + * When ``[devmode]enabled`` is set, the JSON output is sorted. Given by + Aurélien Bompard. 3.0.0 -- "Show Don't Tell" ===================================== src/mailman/rest/helpers.py ===================================== --- a/src/mailman/rest/helpers.py +++ b/src/mailman/rest/helpers.py @@ -110,7 +110,8 @@ def etag(resource): hashfood = pformat(resource).encode('raw-unicode-escape') etag = hashlib.sha1(hashfood).hexdigest() resource['http_etag'] = '"{0}"'.format(etag) - return json.dumps(resource, cls=ExtendedEncoder) + return json.dumps(resource, cls=ExtendedEncoder, + sort_keys=as_boolean(config.devmode.enabled)) View it on GitLab: https://gitlab.com/mailman/mailman/compare/b66d710da04c60d2bbd3fff629126ea50297fbe3...5c996b434a47dffba4c0805677b4940e41f680e5
_______________________________________________ Mailman-checkins mailing list Mailman-checkins@python.org Unsubscribe: https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org