sandboxes.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:cocreate 作者: ngageoint 项目源码 文件源码
def chooseRedirect(request, playground_id, sandbox_id):
    """
    Determine whether we redirect to the playground detail or sandbox detail
    """
    next = request.META.get('HTTP_REFERER', None) or None

    redirectToPlayground = True

    if next is not None:
        match = resolve(urlparse(next)[2])

        if match is not None:
            if match.view_name.startswith("sandbox"):
                redirectToPlayground = False

    if redirectToPlayground:
        return HttpResponseRedirect(reverse("playground", args=[playground_id]))
    else:
        return HttpResponseRedirect(reverse("sandbox-details", args=[playground_id, sandbox_id]))
评论列表


问题


面经


文章

微信
公众号

扫码关注公众号