update coffeescript to use new status url
This commit is contained in:
@@ -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={
|
||||
|
||||
Reference in New Issue
Block a user