Skip to content
Snippets Groups Projects
Commit f0c7d7c6 authored by Francé Wilke's avatar Francé Wilke
Browse files

Fix cleaning of the zone

parent 7b8f48b4
Branches
Tags v1.146.0
No related merge requests found
...@@ -240,10 +240,16 @@ func CleanZone(countryToClean, zoneToClean *string) (newCountry, newZone *string ...@@ -240,10 +240,16 @@ func CleanZone(countryToClean, zoneToClean *string) (newCountry, newZone *string
zone := string_utils.RemoveAllWhiteSpaces(*zoneToClean) zone := string_utils.RemoveAllWhiteSpaces(*zoneToClean)
for provinceCode, province := range Provinces { for provinceCode, province := range Provinces {
found := false
for _, name := range province.Names { for _, name := range province.Names {
if strings.ToLower(zone) == strings.ToLower(string_utils.RemoveAllWhiteSpaces(name)) { if strings.ToLower(zone) == strings.ToLower(string_utils.RemoveAllWhiteSpaces(name)) {
zone = string_utils.ReplaceCaseInsensitive(zone, name, provinceCode) zone = provinceCode
found = true
break
}
} }
if found {
break
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment