[Mpuls-commits] r4257 - in base/trunk: . mpulsweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Nov 23 18:01:40 CET 2010


Author: bh
Date: 2010-11-23 18:01:39 +0100 (Tue, 23 Nov 2010)
New Revision: 4257

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/lib/security.py
Log:
* mpulsweb/lib/security.py (getDbName): Handle case when no
mapping for the db is found.


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2010-11-23 16:39:44 UTC (rev 4256)
+++ base/trunk/ChangeLog	2010-11-23 17:01:39 UTC (rev 4257)
@@ -1,5 +1,10 @@
 2010-11-23  Bernhard Herzog  <bh at intevation.de>
 
+	* mpulsweb/lib/security.py (getDbName): Handle case when no
+	mapping for the db is found.
+
+2010-11-23  Bernhard Herzog  <bh at intevation.de>
+
 	* mpulsweb/model/case.py: Remove unused imports.
 
 2010-11-23  Bernhard Herzog  <bh at intevation.de>

Modified: base/trunk/mpulsweb/lib/security.py
===================================================================
--- base/trunk/mpulsweb/lib/security.py	2010-11-23 16:39:44 UTC (rev 4256)
+++ base/trunk/mpulsweb/lib/security.py	2010-11-23 17:01:39 UTC (rev 4257)
@@ -266,7 +266,10 @@
 def getDbName():
     """Like get_unmapped_db_name, but apply the dbmapping to the name"""
     dbname = get_unmapped_db_name()
-    return g.mpuls_dbmapping.get_mapping().get(dbname).get("dbagency", dbname)
+    mapped_parameters = g.mpuls_dbmapping.get_mapping().get(dbname)
+    if mapped_parameters is not None:
+        dbname = mapped_parameters.get("dbagency", dbname)
+    return dbname
 
 
 def get_kaname_from_http_header():



More information about the Mpuls-commits mailing list