# HG changeset patch # User Mads Kiilerich # Date 1470313416 -7200 # Node ID 5d299d843b4e4e612cfdb658c64954b5a3e6b890 # Parent 86ee450f8b2d0216e4c1b5c3b4ff751bda9488f0 routing: introduce 'my_account_emails_delete' url and use POST instead of DELETE diff -r 86ee450f8b2d -r 5d299d843b4e kallithea/config/routing.py --- a/kallithea/config/routing.py Thu Aug 04 14:23:36 2016 +0200 +++ b/kallithea/config/routing.py Thu Aug 04 14:23:36 2016 +0200 @@ -357,8 +357,8 @@ action="my_account_emails", conditions=dict(method=["GET"])) m.connect("my_account_emails", "/my_account/emails", action="my_account_emails_add", conditions=dict(method=["POST"])) - m.connect("my_account_emails", "/my_account/emails", - action="my_account_emails_delete", conditions=dict(method=["DELETE"])) + m.connect("my_account_emails_delete", "/my_account/emails/delete", + action="my_account_emails_delete", conditions=dict(method=["POST"])) m.connect("my_account_api_keys", "/my_account/api_keys", action="my_account_api_keys", conditions=dict(method=["GET"])) diff -r 86ee450f8b2d -r 5d299d843b4e kallithea/templates/admin/my_account/my_account_emails.html --- a/kallithea/templates/admin/my_account/my_account_emails.html Thu Aug 04 14:23:36 2016 +0200 +++ b/kallithea/templates/admin/my_account/my_account_emails.html Thu Aug 04 14:23:36 2016 +0200 @@ -17,7 +17,7 @@ %endif
${em.email}
- ${h.form(url('my_account_emails'),method='delete')} + ${h.form(url('my_account_emails_delete'))} ${h.hidden('del_email_id',em.email_id)} ${h.submit('remove_',_('Delete'),id="remove_email_%s" % em.email_id, diff -r 86ee450f8b2d -r 5d299d843b4e kallithea/tests/functional/test_my_account.py --- a/kallithea/tests/functional/test_my_account.py Thu Aug 04 14:23:36 2016 +0200 +++ b/kallithea/tests/functional/test_my_account.py Thu Aug 04 14:23:36 2016 +0200 @@ -79,8 +79,8 @@ response.mustcontain('barz@example.com') response.mustcontain('' % email_id) - response = self.app.post(url('my_account_emails'), - {'del_email_id': email_id, '_method': 'delete', '_authentication_token': self.authentication_token()}) + response = self.app.post(url('my_account_emails_delete'), + {'del_email_id': email_id, '_authentication_token': self.authentication_token()}) self.checkSessionFlash(response, 'Removed email from user') response = self.app.get(url('my_account_emails')) response.mustcontain('No additional emails specified')