[Dive4elements-commits] [PATCH 2 of 2] Importer: Do not return true for IsDoubleField set if the field

Wald Commits scm-commit at wald.intevation.org
Thu Mar 21 18:25:09 CET 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1363886687 -3600
# Node ID 90f1c5f67698e48cdc4d5722654f46d5c360be4b
# Parent  51db7fbc2e773675fc1e6ce5a7f962efd0172f68
Importer: Do not return true for IsDoubleField set if the field
does not exist.

    This prohibits the import of km's without a km attribute.

diff -r 51db7fbc2e77 -r 90f1c5f67698 flys-backend/contrib/shpimporter/importer.py
--- a/flys-backend/contrib/shpimporter/importer.py	Thu Mar 21 16:52:07 2013 +0100
+++ b/flys-backend/contrib/shpimporter/importer.py	Thu Mar 21 18:24:47 2013 +0100
@@ -73,6 +73,8 @@
         return result
 
     def IsDoubleFieldSet(self, feat, name):
+        if not self.IsFieldSet(feat, name):
+            return False
         try:
             isset = feat.GetFieldAsDouble(name)
             return isset is not None


More information about the Dive4elements-commits mailing list