From 27e0d591faad365c95928bf2b85a279e216cafa2 Mon Sep 17 00:00:00 2001 From: Sanj Date: Thu, 16 Feb 2012 19:44:08 +0530 Subject: [PATCH] try and fix from_to not found uniqueRouteErrors import --- chaloBEST/imports/import_atlas.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chaloBEST/imports/import_atlas.py b/chaloBEST/imports/import_atlas.py index 0626af9..73389dd 100644 --- a/chaloBEST/imports/import_atlas.py +++ b/chaloBEST/imports/import_atlas.py @@ -146,6 +146,9 @@ def importUniqueRoutes(): obj = UniqueRoute(route=routeObj, is_full=thisRoute['is_full'], distance=distance, from_stop_txt=thisRoute['from'], to_stop_txt=thisRoute['to']) if obj.is_full: #If the route is the primary route, we can get stop codes easily from RouteDetails first / last stop from_to = getFromToStopsForRoute(routeObj) + if not from_to: + routeDoesNotExistErrors.append({'from_to_not_found': route}) + continue obj.from_stop = from_to[0] if not stopMapping.has_key(obj.from_stop_txt): stopMapping[obj.from_stop_txt] = from_to[0].name