From 12e3d0aebf9d3364e4fb82e52565738dfc605d94 Mon Sep 17 00:00:00 2001 From: Jeff Bradberry Date: Mon, 3 Jun 2019 17:35:25 -0400 Subject: [PATCH] Remove rest_framework/base.html --- awx/api/views/__init__.py | 4 +- awx/templates/rest_framework/base.html | 295 ------------------------- 2 files changed, 2 insertions(+), 297 deletions(-) delete mode 100644 awx/templates/rest_framework/base.html diff --git a/awx/api/views/__init__.py b/awx/api/views/__init__.py index f8cf12f670..9f85854cdd 100644 --- a/awx/api/views/__init__.py +++ b/awx/api/views/__init__.py @@ -2,9 +2,9 @@ # All Rights Reserved. # Python -import cgi import dateutil import functools +import html import logging import re import requests @@ -4100,7 +4100,7 @@ class UnifiedJobStdout(RetrieveAPIView): # Remove any ANSI escape sequences containing job event data. content = re.sub(r'\x1b\[K(?:[A-Za-z0-9+/=]+\x1b\[\d+D)+\x1b\[K', '', content) - body = ansiconv.to_html(cgi.escape(content)) + body = ansiconv.to_html(html.escape(content)) context = { 'title': get_view_name(self.__class__), diff --git a/awx/templates/rest_framework/base.html b/awx/templates/rest_framework/base.html deleted file mode 100644 index 959953f69d..0000000000 --- a/awx/templates/rest_framework/base.html +++ /dev/null @@ -1,295 +0,0 @@ -{# Copy of base.html from rest_framework with minor AWX change. #} -{% load staticfiles %} -{% load i18n %} -{% load rest_framework %} - - - - - {% block head %} - - {% block meta %} - - - {% endblock %} - - {% block title %}{% if name %}{{ name }} – {% endif %}Django REST framework{% endblock %} - - {% block style %} - {% block bootstrap_theme %} - - - {% endblock %} - - - - {% endblock %} - - {% endblock %} - - - {% block body %} - - -
- {% block navbar %} - - {% endblock %} - -
- {% block breadcrumbs %} - - {% endblock %} - - -
- {% block content %} - -
- {% if 'GET' in allowed_methods %} -
-
- {% if api_settings.URL_FORMAT_OVERRIDE %} -
- GET - - - -
- {% else %} - GET - {% endif %} -
-
- {% endif %} - - {% if options_form %} -
- -
- {% endif %} - - {% if delete_form %} - - - - - {% endif %} - - {% if filter_form %} - - {% endif %} -
- -
- -
- {% block description %} - {{ description }} - {% endblock %} -
- - {% if paginator %} - - {% endif %} - -
-
{{ request.method }} {{ request.get_full_path }}
-
- -
-
HTTP {{ response.status_code }} {{ response.status_text }}{% autoescape off %}{% if response_headers %}{% for key, val in response_headers|items %}
-{{ key }}: {{ val|break_long_headers|urlize_quoted_links }}{% endfor %}{% endif %}
-{# Original line below had the side effect of also escaping content: #}
-{#   {{ content|urlize_quoted_links }}
{% endautoescape %} #} -{# For AWX, disable automatic URL creation and move content outside of autoescape off block. #} -{% endautoescape %}{{ content }} -
-
- - {% if display_edit_forms %} - {% if post_form or raw_data_post_form %} -
- {% if post_form %} - - {% endif %} - -
- {% if post_form %} -
- {% with form=post_form %} -
-
- {% csrf_token %} - {{ post_form }} -
- -
-
-
- {% endwith %} -
- {% endif %} - -
- {% with form=raw_data_post_form %} -
-
- {% include "rest_framework/raw_data_form.html" %} -
- -
-
-
- {% endwith %} -
-
-
- {% endif %} - - {% if put_form or raw_data_put_form or raw_data_patch_form %} -
- {% if put_form %} - - {% endif %} - -
- {% if put_form %} -
-
-
- {{ put_form }} -
- -
-
-
-
- {% endif %} - -
- {% with form=raw_data_put_or_patch_form %} -
-
- {% include "rest_framework/raw_data_form.html" %} -
- {% if raw_data_put_form %} - - {% endif %} - {% if raw_data_patch_form %} - - {% endif %} -
-
-
- {% endwith %} -
-
-
- {% endif %} - {% endif %} - {% endblock content %} -
-
-
- - {% if filter_form %} - {{ filter_form }} - {% endif %} - - {% block script %} - - - - - - - - - {% endblock %} - - - {% endblock %} -