[Mpuls-commits] r3606 - in wasko/trunk: . waskoweb/model
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Mon Sep 13 17:17:08 CEST 2010
Author: roland
Date: 2010-09-13 17:17:07 +0200 (Mon, 13 Sep 2010)
New Revision: 3606
Modified:
wasko/trunk/ChangeLog
wasko/trunk/waskoweb/model/case.py
Log:
issue1017: automatically enter editor's name for new cases
Modified: wasko/trunk/ChangeLog
===================================================================
--- wasko/trunk/ChangeLog 2010-09-13 14:30:29 UTC (rev 3605)
+++ wasko/trunk/ChangeLog 2010-09-13 15:17:07 UTC (rev 3606)
@@ -4,6 +4,11 @@
2010-09-13 Roland Geider <roland.geider at intevation.de>
+ * waskoweb/model/case.py: issue1017: automatically enter the name of
+ the editor when creating new cases
+
+2010-09-13 Roland Geider <roland.geider at intevation.de>
+
* waskoweb/public/formed/formedtree.xml: issue1019: correct warning
text
Modified: wasko/trunk/waskoweb/model/case.py
===================================================================
--- wasko/trunk/waskoweb/model/case.py 2010-09-13 14:30:29 UTC (rev 3605)
+++ wasko/trunk/waskoweb/model/case.py 2010-09-13 15:17:07 UTC (rev 3606)
@@ -46,9 +46,8 @@
INIT_CASE_SQL = """
UPDATE master_tbl_view
SET
- vorname = %(vorname)s,
- name = %(nachname)s,
- name_kompetenzagentur = %(ka_name)s
+ mitarb_zv = %(vorname)s,
+ mitarb_zn = %(nachname)s
WHERE id = %(id)s"""
SET_EDITOR_SQL = """SELECT set_case_editor(%(userid)s, %(caseid)s)"""
@@ -75,22 +74,22 @@
def _initNewCase(self, id):
pass
- #conn, cur = None, None
- #try:
- # user = session['USER_AUTHORIZED']
- # agency = Agency()
- # fields = {
- # 'vorname': user.first_name,
- # 'nachname': user.last_name,
- # 'ka_name': agency.getName(),
- # 'id': int(id)
- # }
- # conn = db.getConnection()
- # cur = conn.cursor()
- # cur.execute(INIT_CASE_SQL, fields)
- # conn.commit()
- #finally:
- # db.recycleConnection(conn, cur)
+ conn, cur = None, None
+ try:
+ user = session['USER_AUTHORIZED']
+ agency = Agency()
+ fields = {
+ 'vorname': user.first_name,
+ 'nachname': user.last_name,
+ 'id': int(id)
+ }
+ conn = db.getConnection()
+ cur = conn.cursor()
+ #print INIT_CASE_SQL % fields
+ cur.execute(INIT_CASE_SQL, fields)
+ conn.commit()
+ finally:
+ db.recycleConnection(conn, cur)
class Case(MpulsCase):
More information about the Mpuls-commits
mailing list