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