tcl: update TCL to new data source URLs (#71975)
This commit is contained in:
parent
b1ab27ebe6
commit
966cee6fd5
|
@ -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()
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue