Commit b3f7e557 authored by Gabriele Lucci's avatar Gabriele Lucci 🏘

importcsv: Fix error when 'provincia' is malformed

parent 3452090a
......@@ -157,14 +157,15 @@ class Command(BaseCommand):
if sottotipo_created:"%s: CPT sottotipo inserito: %s" % (
cpt_cod_sottotipo, row['CPT_DESCR_SOTTOTIPO']))'cpi_sottotipo: %s', cpt_sottotipo)
provincia = row['PROVINCIA']
if provincia is None:
if provincia is None or len(provincia) > 2:
provincia = ''
provincia = provincia.strip().upper()
if provincia == 'Latina':
provincia = 'LT''Provincia: %s', provincia)
partecipata, partecipata_created = Partecipata.objects.get_or_create(
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment