From 8bbbdce303426020bd386665ed9e60471f858a9e Mon Sep 17 00:00:00 2001 From: dzhuang Date: Mon, 30 Jan 2017 16:29:35 +0800 Subject: [PATCH] Use page_context's built-in attribute page_uri as review_uri instead of building one. --- course/page/code.py | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/course/page/code.py b/course/page/code.py index e1b923cd..409ff6ab 100644 --- a/course/page/code.py +++ b/course/page/code.py @@ -652,23 +652,6 @@ class PythonCodeQuestion(PageBaseWithTitle, PageBaseWithValue): error_msg = "\n".join(error_msg_parts) - review_url = "" - if not page_context.in_sandbox: - - from django.core.urlresolvers import reverse - review_url = reverse( - "relate-view_flow_page", - kwargs={ - 'course_identifier': page_context.course.identifier, - 'flow_session_id': page_context.flow_session.id, - 'ordinal': 0, # page_context.ordinal - } - ) - - from six.moves.urllib.parse import urljoin - review_uri = urljoin(getattr(settings, "RELATE_BASE_URL"), - review_url) - from relate.utils import local_now, format_datetime_local with translation.override(settings.RELATE_ADMIN_EMAIL_LOCALE): from django.template.loader import render_to_string @@ -677,7 +660,7 @@ class PythonCodeQuestion(PageBaseWithTitle, PageBaseWithValue): "page_id": self.page_desc.id, "course": page_context.course, "error_message": error_msg, - "review_uri": review_uri, + "review_uri": page_context.page_uri, "time": format_datetime_local(local_now()) }) -- GitLab