# HG changeset patch # User Mads Kiilerich # Date 2016-08-04 12:23:36 # Node ID d2ce61e4363d32c1187dc890c228aba19d06e090 # Parent 2e294e1fb9e2435deb1dacd7a5fc0ca9cc3aeb87 routing: introduce 'notification_delete' url and use POST instead of DELETE diff --git a/kallithea/config/routing.py b/kallithea/config/routing.py --- a/kallithea/config/routing.py +++ b/kallithea/config/routing.py @@ -379,8 +379,8 @@ def make_map(config): action="index", conditions=dict(method=["GET"])) m.connect("/notifications/{notification_id}", action="update", conditions=dict(method=["PUT"])) - m.connect("/notifications/{notification_id}", - action="delete", conditions=dict(method=["DELETE"])) + m.connect("notification_delete", "/notifications/{notification_id}/delete", + action="delete", conditions=dict(method=["POST"])) m.connect("notification", "/notifications/{notification_id}", action="show", conditions=dict(method=["GET"])) m.connect("formatted_notification", "/notifications/{notification_id}.{format}", 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 @@ -1000,7 +1000,7 @@ var deleteNotification = function(url, n var failure = function(o){ alert("deleteNotification failure"); }; - var postData = {'_method': 'delete'}; + 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 @@ -35,11 +35,12 @@