Do no presume there is at least one host
* larpe/session.py: list can be empty, do not subscript wihtout knowing it's not empty. git-svn-id: svn+ssh://labs.libre-entreprise.org/svnroot/larpe@472 3ed937ae-f919-0410-9a43-8e6f19e4ba6e
This commit is contained in:
parent
e69a4ca86b
commit
298ab6e5aa
|
@ -28,7 +28,9 @@ class BasicSession(Session):
|
|||
user_id = None
|
||||
host = Host.get_host_from_url()
|
||||
if not host:
|
||||
host = Host.select(lambda x: x.name == 'larpe')[0]
|
||||
host_list = Host.select(lambda x: x.name == 'larpe')
|
||||
if host_list:
|
||||
host = host_list[0]
|
||||
if host:
|
||||
user_id = self.users.get(host.provider_id)
|
||||
if not user_id:
|
||||
|
|
Reference in New Issue