Skip to content
Snippets Groups Projects
Commit 29796b58 authored by Jérome Maes's avatar Jérome Maes
Browse files

[IMP] calendar: notification route should be in auth

The 2 calendar notification routes were in auth
`none`. This causes no problem, but since they are
reimplementing the auth user mecanism, it is better
to set them directly in auth `user`. Moreover, they
are only called from webclient, when the user is
logged.

This commit also migrate them to new API (we forgot
them ....)
parent 4b8de95d
Branches
Tags
No related merge requests found
......@@ -59,20 +59,10 @@ class CalendarController(http.Controller):
return response
# Function used, in RPC to check every 5 minutes, if notification to do for an event or not
@http.route('/calendar/notify', type='json', auth="none")
@http.route('/calendar/notify', type='json', auth="user")
def notify(self):
registry = request.registry
uid = request.session.uid
context = request.session.context
with registry.cursor() as cr:
res = registry.get("calendar.alarm_manager").get_next_notif(cr, uid, context=context)
return res
return request.env['calendar.alarm_manager'].get_next_notif()
@http.route('/calendar/notify_ack', type='json', auth="none")
@http.route('/calendar/notify_ack', type='json', auth="user")
def notify_ack(self, type=''):
registry = request.registry
uid = request.session.uid
context = request.session.context
with registry.cursor() as cr:
res = registry.get("res.partner")._set_calendar_last_notif_ack(cr, uid, context=context)
return res
return request.env['res.partner']._set_calendar_last_notif_ack()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment