@blueprint.route('<STR_LIT>', methods=['<STR_LIT:POST>'])<EOL>@login_required<EOL>@pass_community<EOL>@permission_required('<STR_LIT>')<EOL>def delete(community):
deleteform = DeleteCommunityForm(formdata=request.values)<EOL>ctx = mycommunities_ctx()<EOL>ctx.update({<EOL>'<STR_LIT>': deleteform,<EOL>'<STR_LIT>': False,<EOL>'<STR_LIT>': community,<EOL>})<EOL>if deleteform.validate_on_submit():<EOL><INDENT>community.delete()<EOL>db.session.commit()<EOL>flash("<STR_LIT>", category='<STR_LIT:success>')<EOL>return redirect(url_for('<STR_LIT>'))<EOL><DEDENT>else:<EOL><INDENT>flash("<STR_LIT>", category='<STR_LIT>')<EOL>return redirect(url_for('<STR_LIT>', community_id=community.id))<EOL><DEDENT>
Delete a community.