Skip to content
Permalink
Browse files

🛀 avoid sudo() duplication

  • Loading branch information...
trojikman committed Jul 29, 2019
1 parent 448b7c7 commit f77dbd99a2fca88065704ad089359a41d7bff755
Showing with 4 additions and 4 deletions.
  1. +4 −4 saas_public/controllers/saas_public.py
@@ -9,10 +9,10 @@ class SaaSPublicController(Controller):
def create_fast_build(self, template_id, **kwargs):
if not kwargs:
kwargs = {}
template = request.env['saas.template'].browse(template_id)
if template and template.sudo().public_access:
template_operator_id = template.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:
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')

0 comments on commit f77dbd9

Please sign in to comment.
You can’t perform that action at this time.