mirror of https://github.com/snachodog/mybuddy.git
Fix linting issues
This commit is contained in:
parent
0efe0e4f0b
commit
b5d9875e9a
|
@ -17,9 +17,10 @@ class UserTimezoneMiddleware:
|
||||||
self.get_response = get_response
|
self.get_response = get_response
|
||||||
|
|
||||||
def __call__(self, request):
|
def __call__(self, request):
|
||||||
if hasattr(request.user, 'settings') and request.user.settings.timezone:
|
user = request.user
|
||||||
|
if hasattr(user, 'settings') and user.settings.timezone:
|
||||||
try:
|
try:
|
||||||
timezone.activate(pytz.timezone(request.user.settings.timezone))
|
timezone.activate(pytz.timezone(user.settings.timezone))
|
||||||
except pytz.UnknownTimeZoneError:
|
except pytz.UnknownTimeZoneError:
|
||||||
pass
|
pass
|
||||||
return self.get_response(request)
|
return self.get_response(request)
|
||||||
|
|
Loading…
Reference in New Issue