Commit 1c387e4f by Usman Khalid Committed by muzaffaryousaf

Address review feedback.

parent 8bdc0972
...@@ -716,7 +716,6 @@ def get_module_system_for_user(user, student_data, # TODO # pylint: disable=to ...@@ -716,7 +716,6 @@ def get_module_system_for_user(user, student_data, # TODO # pylint: disable=to
"reverification": ReverificationService(), "reverification": ReverificationService(),
'proctoring': ProctoringService(), 'proctoring': ProctoringService(),
'credit': CreditService(), 'credit': CreditService(),
'reverification': ReverificationService(),
'bookmarks': BookmarksService(user=user), 'bookmarks': BookmarksService(user=user),
}, },
get_user_role=lambda: get_user_role(user, course_id), get_user_role=lambda: get_user_role(user, course_id),
......
...@@ -27,3 +27,4 @@ ...@@ -27,3 +27,4 @@
}); });
})(define || RequireJS.define); })(define || RequireJS.define);
...@@ -2,33 +2,32 @@ ...@@ -2,33 +2,32 @@
Defines the URL routes for this app. Defines the URL routes for this app.
""" """
from django.conf import settings
from django.conf.urls import patterns, url from django.conf.urls import patterns, url
from ..profile_images.views import ProfileImageView from ..profile_images.views import ProfileImageView
from .accounts.views import AccountView from .accounts.views import AccountView
from .preferences.views import PreferencesView, PreferencesDetailView from .preferences.views import PreferencesView, PreferencesDetailView
USERNAME_PATTERN = r'(?P<username>[\w.+-]+)'
urlpatterns = patterns( urlpatterns = patterns(
'', '',
url( url(
r'^v1/accounts/{}$'.format(USERNAME_PATTERN), r'^v1/accounts/{}$'.format(settings.USERNAME_PATTERN),
AccountView.as_view(), AccountView.as_view(),
name="accounts_api" name="accounts_api"
), ),
url( url(
r'^v1/accounts/{}/image$'.format(USERNAME_PATTERN), r'^v1/accounts/{}/image$'.format(settings.USERNAME_PATTERN),
ProfileImageView.as_view(), ProfileImageView.as_view(),
name="accounts_profile_image_api" name="accounts_profile_image_api"
), ),
url( url(
r'^v1/preferences/{}$'.format(USERNAME_PATTERN), r'^v1/preferences/{}$'.format(settings.USERNAME_PATTERN),
PreferencesView.as_view(), PreferencesView.as_view(),
name="preferences_api" name="preferences_api"
), ),
url( url(
r'^v1/preferences/{}/(?P<preference_key>[a-zA-Z0-9_]+)$'.format(USERNAME_PATTERN), r'^v1/preferences/{}/(?P<preference_key>[a-zA-Z0-9_]+)$'.format(settings.USERNAME_PATTERN),
PreferencesDetailView.as_view(), PreferencesDetailView.as_view(),
name="preferences_detail_api" name="preferences_detail_api"
), ),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment