From 99554e7f33a42ac8b755633bd985dc1e336d1163 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Dec 29 2015 09:00:25 +0000 Subject: Let's not override the user's instruction if any are provided This way if the user specifies ``?pretty=False`` in its browser it will show as such and not as pretty which would be the default for a browser. --- diff --git a/mdapi/__init__.py b/mdapi/__init__.py index 4b9b07f..7428d37 100644 --- a/mdapi/__init__.py +++ b/mdapi/__init__.py @@ -97,8 +97,9 @@ def _get_pkg(branch, name): def _get_pretty(request): pretty = False get_params = MultiDict(urllib.parse.parse_qsl(request.query_string.lower())) - if str(get_params.get('pretty', None)) in ['1', 'true']: - pretty = True + if get_params.get('pretty'): + if str(get_params.get('pretty', None)) in ['1', 'true']: + pretty = True # Assume pretty if html is requested and pretty is not disabled elif 'text/html' in request.headers.get('ACCEPT', ''): pretty = True