def render_add_build_mock(copr, form, view, package=None): if not form: form = forms.BuildFormMockFactory(copr.active_chroots)() return flask.render_template("coprs/detail/add_build/mock.html", copr=copr, form=form, view=view, package=package)
def process_new_build_mock(copr, add_view, url_on_success): def factory(**build_options): BuildsLogic.create_new_from_mock(flask.g.user, copr, form.scm_type.data, form.scm_url.data, form.scm_branch.data, form.spec.data, form.selected_chroots, **build_options) form = forms.BuildFormMockFactory(copr.active_chroots)() return process_new_build(copr, form, factory, render_add_build_mock, add_view, url_on_success)
def copr_new_build_mock(copr): form = forms.BuildFormMockFactory(copr.active_chroots)(csrf_enabled=False) def create_new_build(): return BuildsLogic.create_new_from_mock( flask.g.user, copr, form.scm_type.data, form.scm_url.data, form.scm_branch.data, form.spec.data, form.selected_chroots, ) return process_creating_new_build(copr, form, create_new_build)
def copr_new_build_mock(copr): """ @deprecated """ form = forms.BuildFormMockFactory(copr.active_chroots)(meta={ 'csrf': False }) def create_new_build(): return BuildsLogic.create_new_from_scm( flask.g.user, copr, scm_type=form.scm_type.data, clone_url=form.scm_url.data, committish=form.scm_branch.data, subdirectory=form.scm_subdir.data, spec=form.spec.data, chroot_names=form.selected_chroots, background=form.background.data, ) return process_creating_new_build(copr, form, create_new_build)