# HG changeset patch # User Mads Kiilerich # Date 2016-08-04 14:23:36 # Node ID 949d50b31c222647a0a9719cd35d01d1e91adb4e # Parent d2ce61e4363d32c1187dc890c228aba19d06e090 routing: introduce 'notification_update' url and use POST instead of PUT diff --git a/kallithea/config/routing.py b/kallithea/config/routing.py --- a/kallithea/config/routing.py +++ b/kallithea/config/routing.py @@ -377,8 +377,8 @@ def make_map(config): action="mark_all_read", conditions=dict(method=["GET"])) m.connect("formatted_notifications", "/notifications.{format}", action="index", conditions=dict(method=["GET"])) - m.connect("/notifications/{notification_id}", - action="update", conditions=dict(method=["PUT"])) + m.connect("notification_update", "/notifications/{notification_id}/update", + action="update", conditions=dict(method=["POST"])) m.connect("notification_delete", "/notifications/{notification_id}/delete", action="delete", conditions=dict(method=["POST"])) m.connect("notification", "/notifications/{notification_id}", diff --git a/kallithea/public/js/base.js b/kallithea/public/js/base.js --- a/kallithea/public/js/base.js +++ b/kallithea/public/js/base.js @@ -1015,7 +1015,7 @@ var readNotification = function(url, not var failure = function(o){ alert("readNotification failure"); }; - var postData = {'_method': 'put'}; + var postData = {}; var sUrl = url.replace('__NOTIFICATION_ID__',notification_id); ajaxPOST(sUrl, postData, success, failure); }; diff --git a/kallithea/templates/admin/notifications/notifications.html b/kallithea/templates/admin/notifications/notifications.html --- a/kallithea/templates/admin/notifications/notifications.html +++ b/kallithea/templates/admin/notifications/notifications.html @@ -36,7 +36,7 @@