Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
improved efficiency
  • Loading branch information
ExpDev07 committed Mar 26, 2020
commit 7ebcc17549bfbd4ab4eb8e3f5df24c4c4bc2cc99
11 changes: 3 additions & 8 deletions app/utils/countrycodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,11 +372,6 @@ def country_code(country):
# Look in synonyms if not found.
if not country in is_3166_1 and country in synonyms:
country = synonyms[country]

# Return code if country was found.
if country in is_3166_1:
return is_3166_1[country]

# Default to default_code.
print("No country_code found for '" + country + "'. Using '" + default_code + "'")
return default_code

# Get country or fallback to default_code.
return is_3166_1.get(country, default_code)