Example #1
0
    def GET_delete(self, pid):
        user_email = helpers.get_loggedin_email()
        if is_author(user_email, pid):
            msg = str(render_plain.confirm_deletion(pid))
            helpers.set_msg(msg)
        else:
            login_link = '<a href="/u/login">Login</a>'
            helpers.set_msg('Only author of this petition can delete it. %s if you are.' % login_link, msg_type='error')

        raise web.seeother('/%s' % pid)
Example #2
0
 def GET_delete(self, pid):
     user_email = helpers.get_loggedin_email()
     if is_author(user_email, pid):
         msg = str(render_plain.confirm_deletion(pid))
     elif user_email:
         msg = "You don't have permissions to delete this petition."
     else:
         login_link = '<a href="/u/login">Login</a>'
         msg = "Only author of this petition can delete it. %s if you are." % login_link
     helpers.set_msg(msg)
     raise web.seeother("/%s" % pid)
Example #3
0
 def GET_delete(self, pid):
     user_email = helpers.get_loggedin_email()
     if is_author(user_email, pid):
         msg = str(render_plain.confirm_deletion(pid))
     elif user_email:
         msg = "You don't have permissions to delete this petition."
     else:
         login_link = '<a href="/u/login">Login</a>'
         msg = 'Only author of this petition can delete it. %s if you are.' % login_link
     helpers.set_msg(msg)
     raise web.seeother('/%s' % pid)