[FIX] pep8
parent
0db61caf20
commit
c5187e5abc
|
@ -23,24 +23,26 @@ from openerp.addons.web.controllers import main as web_main
|
||||||
|
|
||||||
old_init = WebRequest.init
|
old_init = WebRequest.init
|
||||||
|
|
||||||
|
|
||||||
def init(self, params):
|
def init(self, params):
|
||||||
old_init(self, params)
|
old_init(self, params)
|
||||||
if self.httprequest.authorization and not self.session._login:
|
if self.httprequest.authorization and not self.session._login:
|
||||||
dbs = web_main.db_list(self)
|
dbs = web_main.db_list(self)
|
||||||
self.session.authenticate(
|
self.session.authenticate(
|
||||||
dbs and dbs[0],
|
dbs and dbs[0],
|
||||||
self.httprequest.authorization.username,
|
self.httprequest.authorization.username,
|
||||||
self.httprequest.authorization.password,
|
self.httprequest.authorization.password,
|
||||||
dict(
|
dict(
|
||||||
base_location=self.httprequest.url_root.rstrip('/'),
|
base_location=self.httprequest.url_root.rstrip('/'),
|
||||||
HTTP_HOST=self.httprequest.environ['HTTP_HOST'],
|
HTTP_HOST=self.httprequest.environ['HTTP_HOST'],
|
||||||
REMOTE_ADDR=self.httprequest.environ['REMOTE_ADDR']
|
REMOTE_ADDR=self.httprequest.environ['REMOTE_ADDR']
|
||||||
))
|
))
|
||||||
|
|
||||||
WebRequest.init = init
|
WebRequest.init = init
|
||||||
|
|
||||||
old_dispatch = JsonRequest.dispatch
|
old_dispatch = JsonRequest.dispatch
|
||||||
|
|
||||||
|
|
||||||
def dispatch(self, method):
|
def dispatch(self, method):
|
||||||
response = old_dispatch(self, method)
|
response = old_dispatch(self, method)
|
||||||
if method.im_func == web_main.Session.destroy.im_func:
|
if method.im_func == web_main.Session.destroy.im_func:
|
||||||
|
|
|
@ -19,9 +19,9 @@
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
{
|
{
|
||||||
"name" : "Authenticate via HTTP basic authentication",
|
"name": "Authenticate via HTTP basic authentication",
|
||||||
"version" : "1.0",
|
"version": "1.0",
|
||||||
"author" : "Therp BV",
|
"author": "Therp BV",
|
||||||
"complexity": "expert",
|
"complexity": "expert",
|
||||||
"description": """
|
"description": """
|
||||||
In an environment where several web applications authenticate against the same
|
In an environment where several web applications authenticate against the same
|
||||||
|
@ -43,10 +43,10 @@ Funders:
|
||||||
|
|
||||||
Open2bizz software & consultancy
|
Open2bizz software & consultancy
|
||||||
""",
|
""",
|
||||||
"category" : "",
|
"category": "",
|
||||||
"depends" : [
|
"depends": [
|
||||||
],
|
],
|
||||||
"data" : [
|
"data": [
|
||||||
],
|
],
|
||||||
"js": [
|
"js": [
|
||||||
],
|
],
|
||||||
|
@ -56,7 +56,7 @@ Open2bizz software & consultancy
|
||||||
],
|
],
|
||||||
"auto_install": False,
|
"auto_install": False,
|
||||||
"installable": True,
|
"installable": True,
|
||||||
"external_dependencies" : {
|
"external_dependencies": {
|
||||||
'python' : [],
|
'python': [],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,9 +19,9 @@
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
{
|
{
|
||||||
"name" : "Authenticate via HTTP basic authentication (logout helper)",
|
"name": "Authenticate via HTTP basic authentication (logout helper)",
|
||||||
"version" : "1.0",
|
"version": "1.0",
|
||||||
"author" : "Therp BV",
|
"author": "Therp BV",
|
||||||
"complexity": "expert",
|
"complexity": "expert",
|
||||||
"description": """
|
"description": """
|
||||||
With auth_from_http_basic, the logout procedure has to be bent a bit to provide
|
With auth_from_http_basic, the logout procedure has to be bent a bit to provide
|
||||||
|
@ -35,12 +35,12 @@ Funders:
|
||||||
|
|
||||||
Open2bizz software & consultancy
|
Open2bizz software & consultancy
|
||||||
""",
|
""",
|
||||||
"category" : "",
|
"category": "",
|
||||||
"depends" : [
|
"depends": [
|
||||||
'web',
|
'web',
|
||||||
'auth_from_http_basic',
|
'auth_from_http_basic',
|
||||||
],
|
],
|
||||||
"data" : [
|
"data": [
|
||||||
],
|
],
|
||||||
"js": [
|
"js": [
|
||||||
'static/src/js/auth_from_http_basic_logout.js',
|
'static/src/js/auth_from_http_basic_logout.js',
|
||||||
|
@ -51,7 +51,7 @@ Open2bizz software & consultancy
|
||||||
],
|
],
|
||||||
"auto_install": False,
|
"auto_install": False,
|
||||||
"installable": True,
|
"installable": True,
|
||||||
"external_dependencies" : {
|
"external_dependencies": {
|
||||||
'python' : [],
|
'python': [],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue