def roles_create(): form = RoleForm(request.form) if not form.validate(): return render_template("roles/list.html", roles=Role.get_role_list(), form=form) role = Role(form.name.data) try: db.session.add(role) db.session.commit() except IntegrityError: db.session.rollback() return render_template("roles/list.html", roles=Role.get_role_list(), form=form, Roles_name_taken=True) return render_template("roles/list.html", roles=Role.get_role_list(), form=form)
def roles_index(): form = RoleForm() return render_template("roles/list.html", roles=Role.get_role_list(), form=form)