views.py 文件源码

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

项目:Tktr 作者: Intuity 项目源码 文件源码
def profile_view(self):
        # Check agreements
        if not self.user.purchase_agreement:
            return HTTPFound(location=self.request.route_path("purchase_agreement_act"))
        elif not self.user.privacy_agreement:
            return HTTPFound(location=self.request.route_path("privacy_policy_act"))
        # Check we have a complete profile
        if not self.user_details_complete:
            self.request.session.flash("Some details of your profile appear to be incomplete, please correct these.", "info")
            return HTTPFound(location=self.request.route_path("user_profile_edit"))

        # Proceed
        user = self.user
        profile = user.profile

        # Make sure all of our unpurchased tickets have been returned
        issue = Issuer(self.request.root)
        try:
            issue.returnUnpurchasedTickets(user.__name__)
        except Exception:
            self.request.session.flash("Had an issue returning unpurchased tickets, please try again.", "error")

        return {"user": user, "profile": profile,}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号