def modify_message_form(message_id):
    m = Message.query.get(message_id).text
    form = MessageForm()
    form.name.default = m
    form.process()

    return render_template("messages/modifyMessage.html",
                           oldMessage=m,
                           form=form)
Exemple #2
0
def message_edit_form(message_id):
    f = MessageForm()
    m = Message.query.get(message_id)

    if current_user.id != m.account_id and not current_user.roles(
    ).__contains__("ADMIN"):
        return login_manager.unauthorized()

    f.subject.default = m.subject
    f.body.default = m.body
    f.process()

    return render_template("messages/edit.html", form=f, m=m)