Commit 962110061d8d7515d0e86b70eec2e12afd159d2a

Authored by Luan
1 parent 71b461d3

avoiding valuerror on fixed offset

Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
src/tz/middleware.py
@@ -10,11 +10,11 @@ class TimezoneMiddleware(object): @@ -10,11 +10,11 @@ class TimezoneMiddleware(object):
10 10
11 try: 11 try:
12 offset = int(offset) * -1 12 offset = int(offset) * -1
  13 + tz = pytz.FixedOffset(offset)
13 except ValueError: 14 except ValueError:
14 offset = 0 15 offset = 0
15 16
16 if offset: 17 if offset:
17 - tz = pytz.FixedOffset(offset)  
18 timezone.activate(tz) 18 timezone.activate(tz)
19 else: 19 else:
20 timezone.deactivate() 20 timezone.deactivate()