Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions cms/djangoapps/contentstore/views/checklist.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import json
import copy

from django.conf import settings

from util.json_request import JsonResponse
from django.http import HttpResponseBadRequest
from django.contrib.auth.decorators import login_required
Expand Down Expand Up @@ -114,8 +116,14 @@ def expand_checklist_action_url(course_module, checklist):
urlconf_map = {
"ManageUsers": "course_team",
"CourseOutline": "course",
"StaticPages": "tabs",
"SettingsDetails": "settings/details",
"SettingsGrading": "settings/grading",
"SettingsAdvanced": "settings/advanced",
}
lms_urlconf_map = {
"Wiki": "course_wiki",
"Forum": "discussion/forum",
}

for item in expanded_checklist.get('items'):
Expand All @@ -125,5 +133,11 @@ def expand_checklist_action_url(course_module, checklist):
ctx_loc = course_module.location
location = loc_mapper().translate_location(ctx_loc.course_id, ctx_loc, False, True)
item['action_url'] = location.url_reverse(url_prefix, '')
elif action_url in lms_urlconf_map:
lms_base = settings.LMS_BASE
course_id = course_module.location.course_id

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this guaranteed to work? will this ever return a dotted version rather than a / version?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, it always returns / version

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you give some supporting evidence — like point elsewhere in the code that does something similar?

On Apr 15, 2014, at 3:44 PM, Giulio Gratta notifications@github.com wrote:

In cms/djangoapps/contentstore/views/checklist.py:

         ctx_loc = course_module.location
         location = loc_mapper().translate_location(ctx_loc.course_id, ctx_loc, False, True)
         item['action_url'] = location.url_reverse(url_prefix, '')
  •    elif action_url in lms_urlconf_map:
    
  •        lms_base = settings.LMS_BASE
    
  •        course_id = course_module.location.course_id
    
    no, it always returns / version


Reply to this email directly or view it on GitHub.

url_postfix = lms_urlconf_map[action_url]
url = 'http://' + lms_base + '/courses/' + course_id + '/' + url_postfix
item['action_url'] = url

return expanded_checklist
Loading