Browse Source

fixup! [ADD] privacy_consent: Privacy explicit consent tracking tools

pull/11/head
Jairo Llopis 6 years ago
parent
commit
7f3f6d5048
  1. 7
      privacy_consent/controllers/main.py

7
privacy_consent/controllers/main.py

@ -6,6 +6,7 @@ from datetime import datetime
from werkzeug.exceptions import NotFound
from odoo import SUPERUSER_ID
from odoo.http import Controller, request, route
from odoo.addons.web.controllers.main import ensure_db
@ -18,6 +19,12 @@ class ConsentController(Controller):
def consent(self, choice, consent_id, token, *args, **kwargs):
"""Process user's consent acceptance or rejection."""
ensure_db()
try:
# If there's a website, we need a user to render the template
request.uid = request.website.user_id.id
except AttributeError:
# If there's no website, the default is OK
pass
consent = request.env["privacy.consent"] \
.with_context(subject_answering=True) \
.sudo().browse(consent_id)

Loading…
Cancel
Save