summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2020-01-27 16:29:05 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2020-01-27 16:29:05 (GMT)
commita06107e170897a3d377804b39407bf991190e40a (patch)
treed7c82511bbb09c90e49456b6aca2e2b28437c6f4
parent1ef2002cd22c0be74f8083740d6382e863838525 (diff)
downloadmisc-fred-a06107e170897a3d377804b39407bf991190e40a.zip
misc-fred-a06107e170897a3d377804b39407bf991190e40a.tar.gz
misc-fred-a06107e170897a3d377804b39407bf991190e40a.tar.bz2
remove unicode() usage
(actually I don't think this script should be used anymore, but still...)
-rw-r--r--grandlyon/scripts/generate-geojson.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/grandlyon/scripts/generate-geojson.py b/grandlyon/scripts/generate-geojson.py
index 7c79827..024a747 100644
--- a/grandlyon/scripts/generate-geojson.py
+++ b/grandlyon/scripts/generate-geojson.py
@@ -6,6 +6,8 @@ from quixote import get_publisher
from qommon.misc import JSONEncoder
from qommon.storage import Contains
+from django.utils.encoding import force_text
+
from wcs.categories import Category
from wcs.formdef import FormDef
from wcs.backoffice.management import geojson_formdatas
@@ -29,7 +31,7 @@ for formdef in FormDef.select():
formdata = formdef.data_class().get(formdata_id)
formdata_vars = formdata.get_substitution_variables()
for field in ('numero', 'voie', 'commune', 'message', 'type_probleme'):
- feature['properties'][field] = unicode(formdata_vars.get('form_var_%s' % field))
+ feature['properties'][field] = force_text(formdata_vars.get('form_var_%s' % field))
feature['properties']['datetime'] = formdata_vars['form_receipt_datetime'].strftime('%d/%m/%Y %H:%M')
feature['properties']['reference'] = '%s:%s' % (formdata_vars['form_slug'], formdata_id)