update coffeescript to use new status url

This commit is contained in:
Kevin Chugh
2013-07-30 01:43:49 -04:00
parent 986a2cdec2
commit 5c91edd4a5
3 changed files with 3 additions and 4 deletions

View File

@@ -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) ->

View File

@@ -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')

View File

@@ -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={