views.py 文件源码

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

项目:PrivacyScore 作者: PrivacyScore 项目源码 文件源码
def delete_scan_list(request: Request, token: str) -> Response:
    """Update an existing list."""
    # TODO: Access control (Or is token sufficient)?
    try:
        scan_list = ScanList.objects.get(token=token)

        # all related objects CASCADE automatically.
        scan_list.delete()

        return Response({
            'type': 'success',
            'message': 'ok',
        })
    except KeyError as e:
        raise ParseError
    except ScanList.DoesNotExist:
        raise NotFound


# TODO: Why POST?
# TODO: Add a filter option to get_lists and get rid of this search method
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号