Work around unicode/str issue in pytz

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2011-03-07 21:06:04 -06:00
parent 65e965c8f7
commit 0c6ee81eb4

View File

@ -55,7 +55,9 @@ def clock(request):
now = datetime.datetime.now()
utc_now = datetime.datetime.utcnow().replace(tzinfo=pytz.utc)
for dev in devs:
tz = pytz.timezone(dev.userprofile.time_zone)
# Work around https://bugs.launchpad.net/pytz/+bug/718673
timezone = str(dev.userprofile.time_zone)
tz = pytz.timezone(timezone)
dev.current_time = utc_now.astimezone(tz)
page_dict = {