(layer)
Check if shapefile for a given layer has valid column names.
        If not, try to fix column names and warn the user
Check if shapefile for a given layer has valid column names.
        If not, try to fix column names and warn the user
Check if shapefile for a given layer has valid column names . If not try to fix column names and warn the user
def check_shp_columnnames(layer):
    """ Check if shapefile for a given layer has valid column names.
        If not, try to fix column names and warn the user
    """
    # TODO we may add in a better location this method
    inShapefile = ''
    for f in layer.upload_session.layerfile_set.all():
        if os.path.splitext(f.file.name)[1] == '.shp':
            inShapefile = f.file.path
    if inShapefile:
        return fixup_shp_columnnames(inShapefile, layer.charset)
def check_shp_columnnames ( layer ) : # TODO we may add in a better location this method inShapefile = '' for f in layer . upload_session . layerfile_set . all ( ) : if os . path . splitext ( f . file . name ) [ 1 ] == '.shp' : inShapefile = f . file . path if inShapefile : return fixup_shp_columnnames ( inShapefile , layer . charset )