@blueprint.route('<STR_LIT>', methods=['<STR_LIT:POST>'])<EOL>@login_required<EOL>def delete(group_id):
group = Group.query.get_or_404(group_id)<EOL>if group.can_edit(current_user):<EOL><INDENT>try:<EOL><INDENT>group.delete()<EOL><DEDENT>except Exception as e:<EOL><INDENT>flash(str(e), "<STR_LIT:error>")<EOL>return redirect(url_for("<STR_LIT>"))<EOL><DEDENT>flash(_('<STR_LIT>',<EOL>group_name=group.name), '<STR_LIT:success>')<EOL>return redirect(url_for("<STR_LIT>"))<EOL><DEDENT>flash(<EOL>_(<EOL>'<STR_LIT>',<EOL>group_name=group.name<EOL>),<EOL>'<STR_LIT:error>'<EOL>)<EOL>return redirect(url_for("<STR_LIT>"))<EOL>
Delete group.