Compare commits

...

2 Commits

Author SHA1 Message Date
Frédéric Péters 1fbb858798 grandlyon street sections: support data returning null values (#45042)
gitea-wip/passerelle/pipeline/head There was a failure building this commit Details
gitea/passerelle/pipeline/head Something is wrong with the build of this commit Details
2020-07-13 09:29:49 +02:00
Frédéric Péters 2056330836 tcl: allow null line ut (#45037) 2020-07-13 09:29:21 +02:00
3 changed files with 23 additions and 2 deletions

View File

@ -117,7 +117,8 @@ class GrandLyonStreetSections(BaseResource):
for attribute in ('bornemindroite', 'bornemingauche',
'bornemaxdroite', 'bornemaxgauche',
'gid'):
if value.get(attribute) == 'None':
if value.get(attribute) in (None, 'None'):
# data.grandlyon returned 'None' as a string at a time
if 'min' in attribute:
attribute_value = 0
elif 'max' in attribute:

View File

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2020-07-11 10:09
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tcl', '0005_remove_tcl_log_level'),
]
operations = [
migrations.AlterField(
model_name='line',
name='ut',
field=models.CharField(blank=True, max_length=10, null=True),
),
]

View File

@ -155,7 +155,7 @@ class Line(models.Model):
transport_key = models.CharField(max_length=20)
indice = models.CharField(max_length=20, blank=True)
couleur = models.CharField(max_length=20)
ut = models.CharField(max_length=10)
ut = models.CharField(max_length=10, blank=True, null=True)
ligne = models.CharField(max_length=10)
code_titan = models.CharField(max_length=10)
sens = models.CharField(max_length=10)