diff --git a/djangorestframework/renderers.py b/djangorestframework/renderers.py index 1b0796a35..986e0d3af 100644 --- a/djangorestframework/renderers.py +++ b/djangorestframework/renderers.py @@ -355,21 +355,12 @@ class DocumentingTemplateRenderer(BaseRenderer): name = get_name(self.view) description = get_description(self.view) - markeddown = {} + markeddown = None if apply_markdown: try: - markeddown['view'] = apply_markdown(description) + markeddown = apply_markdown(description) except AttributeError: - markeddown.pop('view', None) - for method in self.view.allowed_methods: - methodfunc = getattr(self.view, method.lower(), None) - if methodfunc is None: - continue - methoddesc = get_description(methodfunc) - try: - markeddown[method] = apply_markdown(methoddesc) - except AttributeError: - markeddown.pop(method, None) + markeddown = None breadcrumb_list = get_breadcrumbs(self.view.request.path) diff --git a/djangorestframework/templates/renderer.html b/djangorestframework/templates/renderer.html index 94ea3f966..132bdb818 100644 --- a/djangorestframework/templates/renderer.html +++ b/djangorestframework/templates/renderer.html @@ -45,7 +45,7 @@
{% if markeddown.view %}{% autoescape off %}{{ markeddown.view }}{% endautoescape %}{% else %}{{ description|linebreaksbr }}{% endif %}
{% if markeddown %}{% autoescape off %}{{ markeddown }}{% endautoescape %}{% else %}{{ description|linebreaksbr }}{% endif %}
{{ response.status }} {{ response.status_text }}{% autoescape off %} {% for key, val in response.headers.items %}{{ key }}: {{ val|urlize_quoted_links }} @@ -56,7 +56,6 @@
{% autoescape off %}{{ markeddown.GET }}{% endautoescape %}
{% autoescape off %}{{ markeddown.POST }}{% endautoescape %}
{% autoescape off %}{{ markeddown.PUT }}{% endautoescape %}
{% autoescape off %}{{ markeddown.DELETE }}{% endautoescape %}