[Mpuls-commits] r5365 - in jmd/trunk/jmdweb: controllers model
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Fri Sep 16 11:45:12 CEST 2011
Author: roland
Date: 2011-09-16 11:45:12 +0200 (Fri, 16 Sep 2011)
New Revision: 5365
Modified:
jmd/trunk/jmdweb/controllers/administration.py
jmd/trunk/jmdweb/model/struktur.py
Log:
issue1616: pass also the agency for selecting users for deletion
Modified: jmd/trunk/jmdweb/controllers/administration.py
===================================================================
--- jmd/trunk/jmdweb/controllers/administration.py 2011-09-16 09:38:42 UTC (rev 5364)
+++ jmd/trunk/jmdweb/controllers/administration.py 2011-09-16 09:45:12 UTC (rev 5365)
@@ -63,4 +63,4 @@
Here the user's rights to access the structure part are removed.
"""
uo = UserObject(id)
- remove_struktur_user_by_login(uo.login)
\ No newline at end of file
+ remove_struktur_user_by_login(uo.login, uo.agency)
\ No newline at end of file
Modified: jmd/trunk/jmdweb/model/struktur.py
===================================================================
--- jmd/trunk/jmdweb/model/struktur.py 2011-09-16 09:38:42 UTC (rev 5364)
+++ jmd/trunk/jmdweb/model/struktur.py 2011-09-16 09:45:12 UTC (rev 5365)
@@ -76,7 +76,7 @@
return user_ids
-def remove_struktur_user_by_login(user_login):
+def remove_struktur_user_by_login(user_login, user_agency):
"""
Deletes user from the ka_benutzer_tbl on the structure part.
"""
@@ -86,8 +86,9 @@
try:
con = struktur_db.getConnection()
cur = con.cursor()
- cur.execute("SELECT id FROM ka_benutzer_tbl WHERE login LIKE 'ka_%%_%s'" \
- % user_login)
+ cur.execute("SELECT id FROM ka_benutzer_tbl WHERE login = 'ka_%s_%s'" \
+ % (user_agency, user_login))
+ print cur.query
row = cur.fetchone()
if row:
remove_struktur_user_by_id(row[0])
More information about the Mpuls-commits
mailing list