summaryrefslogtreecommitdiff
path: root/addons/calendar/controllers/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'addons/calendar/controllers/main.py')
-rw-r--r--addons/calendar/controllers/main.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/addons/calendar/controllers/main.py b/addons/calendar/controllers/main.py
index f341483fed6..e68a5bab412 100644
--- a/addons/calendar/controllers/main.py
+++ b/addons/calendar/controllers/main.py
@@ -14,7 +14,7 @@ class CalendarController(http.Controller):
# YTI Note: Keep id and kwargs only for retrocompatibility purpose
@http.route('/calendar/meeting/accept', type='http', auth="calendar")
def accept_meeting(self, token, id, **kwargs):
- attendee = request.env['calendar.attendee'].search([
+ attendee = request.env['calendar.attendee'].sudo().search([
('access_token', '=', token),
('state', '!=', 'accepted')])
attendee.do_accept()
@@ -36,7 +36,7 @@ class CalendarController(http.Controller):
@http.route('/calendar/meeting/decline', type='http', auth="calendar")
def decline_meeting(self, token, id, **kwargs):
- attendee = request.env['calendar.attendee'].search([
+ attendee = request.env['calendar.attendee'].sudo().search([
('access_token', '=', token),
('state', '!=', 'declined')])
attendee.do_decline()
@@ -58,19 +58,19 @@ class CalendarController(http.Controller):
@http.route('/calendar/meeting/view', type='http', auth="calendar")
def view_meeting(self, token, id, **kwargs):
- attendee = request.env['calendar.attendee'].search([
+ attendee = request.env['calendar.attendee'].sudo().search([
('access_token', '=', token),
('event_id', '=', int(id))])
if not attendee:
return request.not_found()
timezone = attendee.partner_id.tz
lang = attendee.partner_id.lang or get_lang(request.env).code
- event = request.env['calendar.event'].with_context(tz=timezone, lang=lang).browse(int(id))
+ event = request.env['calendar.event'].with_context(tz=timezone, lang=lang).sudo().browse(int(id))
# If user is internal and logged, redirect to form view of event
# otherwise, display the simplifyed web page with event informations
if request.session.uid and request.env['res.users'].browse(request.session.uid).user_has_groups('base.group_user'):
- return werkzeug.utils.redirect('/web?db=%s#id=%s&view_type=form&model=calendar.event' % (self.env.cr.dbname, id))
+ return werkzeug.utils.redirect('/web?db=%s#id=%s&view_type=form&model=calendar.event' % (request.env.cr.dbname, id))
# NOTE : we don't use request.render() since:
# - we need a template rendering which is not lazy, to render before cursor closing