Skip to content

Commit

Permalink
Detection problem
Browse files Browse the repository at this point in the history
The country_code here ends up in lowercase and if fails.
Added .upper()
  • Loading branch information
swiftslipper authored and paluh committed Dec 18, 2011
1 parent c83fac5 commit 6fcb8f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion django_tz/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ def coerce_timezone_value(value):

def guess_tz_from_lang(language_code):
country_code = language_code.split('-', 1)[1] if '-' in language_code else language_code
if country_code in pytz.country_timezones:
if country_code.upper() in pytz.country_timezones:
return pytz.country_timezones[country_code][0]
return None

0 comments on commit 6fcb8f1

Please sign in to comment.