Commit 5c91edd4 by Kevin Chugh

update coffeescript to use new status url

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