views.py 文件源码

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

项目:Tktr 作者: Intuity 项目源码 文件源码
def privacy_policy_view(self):
        if not self.user.purchase_agreement:
            return HTTPFound(location=self.request.route_path("purchase_agreement_act"))
        elif self.user.privacy_agreement:
            return HTTPFound(location=self.request.route_path("user_profile"))
        agreement_doc = PROP_KEYS.getProperty(self.request, PROP_KEYS.PRIVACY_POLICY)
        if "submit" in self.request.POST:
            # Verify the checkbox is checked
            chk_response = ("agreement" in self.request.POST and self.request.POST["agreement"] == "agreed")
            if chk_response:
                self.user.privacy_agreement = True
                return HTTPFound(location=self.request.route_path("user_profile"))
            else:
                self.request.session.flash("The form was submitted without you accepting the privacy policy. Please first accept the agreement and then click submit.", "error")
        return {
            "document": agreement_doc
        }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号