transition.py 文件源码

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

项目:django-lb-workflow 作者: vicalloy 项目源码 文件源码
def raise_no_permission_exception(self, instance=None):
        from django.template import Context, Template
        t = Template("""
            <!DOCTYPE HTML>
            <html lang="en">
            <head>
                <meta charset="UTF-8">
                <title></title>
            </head>
            <body>
                No permission to perform this action
                {% if instance %}
                    <br/>
                    <a href="{% url 'wf_detail' instance.pk %}"> View this process </a>
                {% endif %}
            </body>
            </html>
            """)
        http_response = HttpResponse(
            t.render(Context({"instance": instance})), content_type='text/html', status=403)
        raise HttpResponseException(http_response)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号