try and fix from_to not found uniqueRouteErrors import

This commit is contained in:
Sanj 2012-02-16 19:44:08 +05:30
parent 0c6a173065
commit 27e0d591fa

View File

@ -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