tcl: update TCL to new data source URLs (#71975)
gitea-wip/passerelle/pipeline/pr-main This commit looks good Details
gitea-wip/passerelle/pipeline/head Build started... Details
gitea/passerelle/pipeline/head Something is wrong with the build of this commit Details

This commit is contained in:
Frédéric Péters 2022-12-02 15:52:09 +01:00
parent b1ab27ebe6
commit 966cee6fd5
2 changed files with 5 additions and 4 deletions

View File

@ -127,7 +127,7 @@ class Tcl(BaseResource):
with transaction.atomic():
for key in ('tcllignebus', 'tcllignemf', 'tcllignetram'):
url = get_tcl_data_url(key)
url = get_tcl_data_url(key + '_2_0_0')
response = self.requests.get(url)
response.raise_for_status()
for line_data in response.json()['values']:
@ -139,6 +139,7 @@ class Tcl(BaseResource):
code_titan=line_data['code_titan'],
defaults={'transport_key': key, 'ligne': line_data['ligne']},
)
line.ut = None
line.__dict__.update(line_data)
line.transport_key = key
line.save()

View File

@ -115,9 +115,9 @@ def connector(db):
def tcl_responses(url, **kwargs):
content = {
'/tcllignebus': LIGNE_BUS,
'/tcllignemf': LIGNE_MF,
'/tcllignetram': LIGNE_TRAM,
'/tcllignebus_2_0_0': LIGNE_BUS,
'/tcllignemf_2_0_0': LIGNE_MF,
'/tcllignetram_2_0_0': LIGNE_TRAM,
'/geojson/tclarret': ARRETS,
'/tclpassagearret': PASSAGES,
}.get(urlparse.urlparse(url).path)