Changeset - 5d299d843b4e
[Not reviewed]
default
0 3 0
Mads Kiilerich - 9 years ago 2016-08-04 14:23:36
madski@unity3d.com
routing: introduce 'my_account_emails_delete' url and use POST instead of DELETE
3 files changed with 5 insertions and 5 deletions:
0 comments (0 inline, 0 general)
kallithea/config/routing.py
Show inline comments
 
@@ -357,8 +357,8 @@ def make_map(config):
 
                  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"]))
kallithea/templates/admin/my_account/my_account_emails.html
Show inline comments
 
@@ -17,7 +17,7 @@
 
            %endif
 
            <td><div class="email">${em.email}</div></td>
 
            <td>
 
                ${h.form(url('my_account_emails'),method='delete')}
 
                ${h.form(url('my_account_emails_delete'))}
 
                    ${h.hidden('del_email_id',em.email_id)}
 
                    <i class="icon-minus-circled" style="color:#FF4444"></i>
 
                    ${h.submit('remove_',_('Delete'),id="remove_email_%s" % em.email_id,
kallithea/tests/functional/test_my_account.py
Show inline comments
 
@@ -79,8 +79,8 @@ class TestMyAccountController(TestContro
 
        response.mustcontain('barz@example.com')
 
        response.mustcontain('<input id="del_email_id" name="del_email_id" type="hidden" value="%s" />' % 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')
0 comments (0 inline, 0 general)