Exemple #1
0
def confirm_action(request, message, endpoint, **kwargs):
    """Flash a csrf protected "Are you sure?" form."""
    from inyoka.core.api import render_template, href
    from inyoka.core.forms import Form
    form = Form(request.form)
    if form.validate_on_submit():
        return 'confirm' in request.form
    request.flash(render_template('utils/confirm.html', {
        'message': message,
        'form': form,
        'destination': href(endpoint, **kwargs)
    }), html=True)
    return False
Exemple #2
0
 def __init__(self, auth_system, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     self.auth_system = auth_system
     if self.auth_system.passwordless:
         del self.password
Exemple #3
0
 def __init__(self, auth_system, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     self.auth_system = auth_system
     if self.auth_system.passwordless:
         del self.password