server/session.py
changeset 2466 c4ccfd38a542
parent 2319 654decb099e3
child 2589 92f2bc945261
child 2613 5e19c2bb370e
--- a/server/session.py	Fri Jul 24 09:31:43 2009 +0200
+++ b/server/session.py	Fri Jul 24 10:36:57 2009 +0200
@@ -194,7 +194,14 @@
         raise KeyError(eid)
 
     def base_url(self):
-        return self.repo.config['base-url'] or u''
+        url = self.repo.config['base-url']
+        if not url:
+            try:
+                url = self.repo.config.default_base_url()
+            except AttributeError: # default_base_url() might not be available
+                self.warning('missing base-url definition in server config')
+                url = u''
+        return url
 
     def from_controller(self):
         """return the id (string) of the controller issuing the request (no