views.py 文件源码

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

项目:ablator 作者: ablator 项目源码 文件源码
def get(self, request, client_user_string, functionality_group_id):
        """
        Which Flavor of the given Functionality is enabled for the user, if any?

        Returns `{ "which": "<app.group.functionality>" }` that corresponds to the ClientUser's
        enabled functionality, or `{ "which": none }` if the user does not have any Flavor in
        the given FuncationlityGroup.

        If the Functionality does not exist, this endpoint returns a 404 error.

        """
        functionality_group = get_object_or_404(Functionality, id=functionality_group_id)
        client_user = ClientUser.user_from_object(client_user_string)
        availability = which(client_user, functionality_group)
        return Response({
            'functionality': availability.flavor.__str__() if availability else None,
        })
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号