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,}
评论列表
文章目录