Commit 5c91edd4 by Kevin Chugh

update coffeescript to use new status url

parent 986a2cde
......@@ -84,7 +84,7 @@ class @DiscussionUtil
threads : "/courses/#{$$course_id}/discussion/forum"
"enable_notifications" : "/notification_prefs/enable/"
"disable_notifications" : "/notification_prefs/disable/"
"notifications_status" : "/user_api/v1/user_prefs/?key=notification_pref&use=#{param}"
"notifications_status" : "notification_prefs/status/user_prefs/?key=notification_pref&use=#{param}"
}[name]
@safeAjax: (params) ->
......
......@@ -202,9 +202,8 @@ if Backbone?
DiscussionUtil.safeAjax
url: url
type: "GET"
dataType: 'json'
success: (response, textStatus) =>
if response.count==1
if response.status
$('input.email-setting').attr('checked','checked')
else
$('input.email-setting').removeAttr('checked')
......
......@@ -142,7 +142,7 @@ def ajax_status(request):
if not request.user.is_authenticated():
raise PermissionDenied
prefs UserPreference.objects.get(
prefs = UserPreference.objects.get(
user=request.user,
key=NOTIFICATION_PREF_KEY,
defaults={
......
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