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.
 
 
 

18 lines
587 B

# -*- coding: utf-8 -*-
import time
from odoo import http
from odoo.http import request
from odoo.addons import web
class Home(web.controllers.home.Home):
@http.route('/web/login', type='http', auth="none")
def web_login(self, redirect=None, **kw):
result = super(Home, self).web_login(redirect, **kw)
if result.is_qweb and 'force_auth_and_redirect' in kw:
result.qcontext['redirect'] = kw['force_auth_and_redirect']
if request.params.get('login_success'):
request.session['auth_time'] = int(time.time())
return result