edit import_atlas to use Route if routeMapping.json does not contain mapping
This commit is contained in:
parent
0e37c60b34
commit
91a25d1f5b
|
@ -123,12 +123,19 @@ def importUniqueRoutes():
|
||||||
stopMapping = {} #FIXME
|
stopMapping = {} #FIXME
|
||||||
stopErrors = [] #This should ideally never happen, and any errors here are bad and would indicate problems with the fuzzy matching logic, most likely.
|
stopErrors = [] #This should ideally never happen, and any errors here are bad and would indicate problems with the fuzzy matching logic, most likely.
|
||||||
for route in data.keys():
|
for route in data.keys():
|
||||||
routeCode = routeMapping[route]
|
if routeMapping.has_key(route):
|
||||||
try:
|
routeCode = routeMapping[route]
|
||||||
routeObj = Route.objects.get(code=routeCode)
|
try:
|
||||||
except:
|
routeObj = Route.objects.get(code=routeCode)
|
||||||
routeDoesNotExistErrors.append({'routeCode': routeCode, 'routeAlias': route})
|
except:
|
||||||
continue
|
routeDoesNotExistErrors.append({'routeCode': routeCode, 'routeAlias': route})
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
routeObj = Route.objects.get(alias=route)
|
||||||
|
except:
|
||||||
|
routeDoesNotExistErrors.append({'routeAlias': route})
|
||||||
|
|
||||||
for unique_route in data[route]:
|
for unique_route in data[route]:
|
||||||
thisRoute = unique_route #FIXME
|
thisRoute = unique_route #FIXME
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user