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.

15 lines
542 B

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