summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbdauvergne <bdauvergne@3ed937ae-f919-0410-9a43-8e6f19e4ba6e>2009-04-27 13:02:38 (GMT)
committerbdauvergne <bdauvergne@3ed937ae-f919-0410-9a43-8e6f19e4ba6e>2009-04-27 13:02:38 (GMT)
commit298ab6e5aafacd9147569fc0f9796e8041ebdd44 (patch)
treeea9bdc4c33c0801c09327cedab3fa78a9a482f10
parente69a4ca86be5744f78335f57289f83842cbab3e3 (diff)
downloadlarpe-298ab6e5aafacd9147569fc0f9796e8041ebdd44.zip
larpe-298ab6e5aafacd9147569fc0f9796e8041ebdd44.tar.gz
larpe-298ab6e5aafacd9147569fc0f9796e8041ebdd44.tar.bz2
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
-rw-r--r--larpe/trunk/larpe/sessions.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/larpe/trunk/larpe/sessions.py b/larpe/trunk/larpe/sessions.py
index f7e2221..8c27e76 100644
--- a/larpe/trunk/larpe/sessions.py
+++ b/larpe/trunk/larpe/sessions.py
@@ -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: