def ticket_details_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"))
tick_id = self.request.matchdict["tick_id"]
ticket = None
# Find ticket
for tick in self.user.tickets:
if tick.__name__ == tick_id:
ticket = tick
break
# Safety
if ticket == None:
self.request.session.flash("Ticket does not exist.", "error")
return HTTPFound(location=self.request.route_path("user_profile"))
return {
"ticket": ticket
}
评论列表
文章目录