def delete_domain(id): d = Domain.get(id) if not d: abort(404) d.delete() return redirect(url_for('admin.domain_show'))