Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

12.0 saas public website compatibility #24

Merged
merged 1 commit into from
Jul 29, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions saas_public/controllers/saas_public.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@


class SaaSPublicController(Controller):
@route('/saas_public/<model("saas.template"):template_id>/create-fast-build', type='http', auth='public')
@route('/saas_public/<int:template_id>/create-fast-build', type='http', auth='public')
def create_fast_build(self, template_id, **kwargs):
if not kwargs:
kwargs = {}
if template_id and template_id.sudo().public_access:
template_operator_id = template_id.sudo().operator_ids.random_ready_operator()
build = template_operator_id.sudo().create_db(kwargs, with_delay=False)
template = request.env['saas.template'].browse(template_id).sudo()
if template and template.public_access:
yelizariev marked this conversation as resolved.
Show resolved Hide resolved
template_operator_id = template.operator_ids.random_ready_operator()
build = template_operator_id.create_db(kwargs, with_delay=False)
build_url = build.get_url()
return request.env['auth_quick_master.token'].sudo().redirect_with_token(build_url, build.id,
build_login='admin')
Expand Down