[Mpuls-commits] r5194 - base/trunk/mpulsweb/model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Jul 27 10:07:02 CEST 2011


Author: torsten
Date: 2011-07-27 10:06:59 +0200 (Wed, 27 Jul 2011)
New Revision: 5194

Modified:
   base/trunk/mpulsweb/model/case.py
Log:
Anlegen einer Liste mit vordefinierten Feldern in der master_tbl
(bearbeiter_id). Ignoriere die Anfrage zum holen eines Formed-Items wenn es
sich um eines dieser Felder handelt, da es nur unn?\195?\182tige Fehlerausgaben nach
sich zieht.


Modified: base/trunk/mpulsweb/model/case.py
===================================================================
--- base/trunk/mpulsweb/model/case.py	2011-07-27 07:43:33 UTC (rev 5193)
+++ base/trunk/mpulsweb/model/case.py	2011-07-27 08:06:59 UTC (rev 5194)
@@ -67,6 +67,7 @@
 
 log = logging.getLogger(__name__)
 
+PRESET_FIELDS_IN_MASTERTABLE = ['bearbeiter_id']
 
 LOAD_CASE_SQL = """\
 SELECT
@@ -629,10 +630,15 @@
 
     def get_formed_item(self, name):
         self._load_formed_instance_tree()
-        fid = get_field_identifier(self.id, name, self.formed_instance)
-        if fid:
-            return self.formed_instance.getItem(fid)
-        log.error('(get_formed_item): Can not find %s' % name)
+        # Some fields are not part of the formed tree because they are preset
+        # fields of the master_tbl. Do not try to get a field identifier/formed
+        # item for these fields as this would cause an error anyway. Ignore an
+        # return None 
+        if name not in PRESET_FIELDS_IN_MASTERTABLE:
+            fid = get_field_identifier(self.id, name, self.formed_instance)
+            if fid:
+                return self.formed_instance.getItem(fid)
+            log.error('(get_formed_item): Can not find %s' % name)
         return None
 
     def get_description(self, name):



More information about the Mpuls-commits mailing list