def scheduleSandboxDeployment(request, sbr):
"""
Given a newly created sandbox request, schedule the deployment with the backend. This
will also handle any quota checking, notifications, and environment specific prep.
"""
if sbr.sandbox.playground.environment == 'locl':
# local deploy, no formal request
sbr.request_status = 'avl'
sbr.save()
else:
# environment deploy, let's kick it to the admins
sandbox_request_uri = request.build_absolute_uri(reverse('admin:cocreate_sandboxrequest_change', args=(sbr.id,)))
mail_admins(
"Sandbox Request for Review",
"There's a new request for review at " + sandbox_request_uri,
html_message = get_template("sandboxRequestToAdmins.html").render(Context({"sandbox_request_uri": sandbox_request_uri}))
)
评论列表
文章目录