You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
567 B

  1. # -*- coding: utf-8 -*-
  2. import time
  3. from odoo import http
  4. from odoo.addons import web
  5. class Home(web.controllers.main.Home):
  6. @http.route('/web/login', type='http', auth="none")
  7. def web_login(self, redirect=None, **kw):
  8. result = super(Home, self).web_login(redirect, **kw)
  9. if result.is_qweb and 'force_auth_and_redirect' in kw:
  10. result.qcontext['redirect'] = kw['force_auth_and_redirect']
  11. if http.request.params.get('login_success'):
  12. http.request.session['auth_time'] = int(time.time())
  13. return result