def import_location(shapefile, layer_number, location_type, name, wkt, filter_bounds, display_order): # Passing WKT because background functions need all their args to # be json-serializable. try: layer = layer_from_shapefile(shapefile, layer_number) importer = LocationImporter(layer, location_type, filter_bounds=filter_bounds) geom = GEOSGeometry(wkt) importer.create_location(name, location_type, geom, display_order=display_order) except: logger.exception("Location import of %s failed" % name)