[Mpuls-commits] r1286 - in wasko/branches/2.0: . mpulsweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Feb 5 17:59:51 CET 2010


Author: bh
Date: 2010-02-05 17:59:49 +0100 (Fri, 05 Feb 2010)
New Revision: 1286

Modified:
   wasko/branches/2.0/ChangeLog
   wasko/branches/2.0/mpulsweb/lib/security.py
Log:
* mpulsweb/lib/security.py (checkLogin): Move the import of
SessionUser, SessionSuperAdmin toward the beginning of the
function outside of any try/except blocks so that import errors
are not suppressed.  Fix the module name because the module is now
in mpulsweb.


Modified: wasko/branches/2.0/ChangeLog
===================================================================
--- wasko/branches/2.0/ChangeLog	2010-02-05 15:27:40 UTC (rev 1285)
+++ wasko/branches/2.0/ChangeLog	2010-02-05 16:59:49 UTC (rev 1286)
@@ -1,5 +1,13 @@
 2010-02-05  Bernhard Herzog  <bh at intevation.de>
 
+	* mpulsweb/lib/security.py (checkLogin): Move the import of
+	SessionUser, SessionSuperAdmin toward the beginning of the
+	function outside of any try/except blocks so that import errors
+	are not suppressed.  Fix the module name because the module is now
+	in mpulsweb.
+
+2010-02-05  Bernhard Herzog  <bh at intevation.de>
+
 	* waskaweb/controllers/case.py (CaseController.newAction): Always
 	create a new SessionCase object and make sure it's actually stored
 	in the session.

Modified: wasko/branches/2.0/mpulsweb/lib/security.py
===================================================================
--- wasko/branches/2.0/mpulsweb/lib/security.py	2010-02-05 15:27:40 UTC (rev 1285)
+++ wasko/branches/2.0/mpulsweb/lib/security.py	2010-02-05 16:59:49 UTC (rev 1286)
@@ -101,6 +101,10 @@
     # database returns Unicode objects directly.
     from mpulsweb.lib.helpers import ensure_unicode
 
+    # Also imported here because mpulsweb.model.user imports
+    # mpulsweb.lib.security, which leads to circular imports.
+    from mpulsweb.model.user import SessionUser, SessionSuperAdmin
+
     log.info('Login: user "%s" in "%s"' % (user, dbname))
     try:
         mydb = DB(dbname=config.get('mpuls.db.database') % dbname, 
@@ -136,7 +140,6 @@
                 db.recycleConnection(conn, cursor)
 
             try:
-                from waskaweb.model.user import SessionUser, SessionSuperAdmin
                 if data:
                     userobject = SessionUser(login, password)
                     userobject.setData(data)



More information about the Mpuls-commits mailing list