[Mpuls-commits] r1043 - in wasko/branches/2.0: . waskaweb/model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Feb 1 11:35:25 CET 2010


Author: bh
Date: 2010-02-01 11:35:24 +0100 (Mon, 01 Feb 2010)
New Revision: 1043

Modified:
   wasko/branches/2.0/ChangeLog
   wasko/branches/2.0/waskaweb/model/agencysettings.py
Log:
* waskaweb/model/agencysettings.py (Agency._fetchData): Use
ensure_unicode to convert the values to unicode immediately when
read from the database.
(Agency.getFKZ, Agency.getName, Agency.getMaxSavetime)
(Agency.getPrivacyStatement, Agency.getDiscretionStatement): The
config value are already unicode now, so don't try to convert them
again, here.


Modified: wasko/branches/2.0/ChangeLog
===================================================================
--- wasko/branches/2.0/ChangeLog	2010-02-01 10:28:46 UTC (rev 1042)
+++ wasko/branches/2.0/ChangeLog	2010-02-01 10:35:24 UTC (rev 1043)
@@ -1,3 +1,13 @@
+2010-02-01  Bernhard Herzog  <bh at intevation.de>
+
+	* waskaweb/model/agencysettings.py (Agency._fetchData): Use
+	ensure_unicode to convert the values to unicode immediately when
+	read from the database.
+	(Agency.getFKZ, Agency.getName, Agency.getMaxSavetime)
+	(Agency.getPrivacyStatement, Agency.getDiscretionStatement): The
+	config value are already unicode now, so don't try to convert them
+	again, here.
+
 2010-02-01  Torsten Irländer <torsten.irlaender at intevation.de>
 
 	* waskaweb/model/casedocument.py (CaseDocument): Deleted. Class is not

Modified: wasko/branches/2.0/waskaweb/model/agencysettings.py
===================================================================
--- wasko/branches/2.0/waskaweb/model/agencysettings.py	2010-02-01 10:28:46 UTC (rev 1042)
+++ wasko/branches/2.0/waskaweb/model/agencysettings.py	2010-02-01 10:35:24 UTC (rev 1043)
@@ -35,6 +35,7 @@
 
 from waskaweb.lib.config import get_path
 from waskaweb.lib.db import db
+from waskaweb.lib.helpers import ensure_unicode
 
 
 FETCH_SETTINGS_SQL = """SELECT bez, wert from ka_konfiguration_tbl_view"""
@@ -56,7 +57,7 @@
             cur.execute(FETCH_SETTINGS_SQL)
             rows = cur.fetchall()
             for row in rows:
-                self.conf[row['bez']] = row['wert']
+                self.conf[row['bez']] = ensure_unicode(row['wert'])
         finally:
             db.recycleConnection(conn, cur)
 
@@ -89,13 +90,13 @@
         return anon == 'on' or anon == '1'
 
     def getFKZ(self):
-        return unicode(str(self.conf.get('fkz', '')), 'utf-8')
+        return self.conf.get('fkz', u'')
 
     def getName(self):
-        return unicode(str(self.conf.get('ka_name', '')), 'utf-8')
+        return self.conf.get('ka_name', u'')
 
     def getMaxSavetime(self):
-        return unicode(str(self.conf.get('max_speicherdauer', '')), 'utf-8')
+        return self.conf.get('max_speicherdauer', u'')
 
     def _loadDefaultStatement(self, filename):
         # XXX: Dead ugly!
@@ -114,14 +115,14 @@
     def getPrivacyStatement(self):
         form = self.conf.get('ee_formular', '')
         if len(form) > 0:
-            return unicode(form, 'utf-8')
+            return form
         return self._loadDefaultStatement(get_path('formed',
                                                    'privacy_statement.html'))
 
     def getDiscretionStatement(self):
         form = self.conf.get('ud_formular', '')
         if len(form) > 0:
-            return unicode(form, 'utf-8')
+            return form
         return self._loadDefaultStatement(get_path('formed',
                                                    'discretion_statement.html'))
 



More information about the Mpuls-commits mailing list