diff options
| author | Bobby <[email protected]> | 2023-05-31 18:38:27 -0400 |
|---|---|---|
| committer | Bobby <[email protected]> | 2023-05-31 18:38:27 -0400 |
| commit | 7689596bf4582d95640386f7495d1786c67678d4 (patch) | |
| tree | 6993a6f0b74ca41bb781c651c174d8602ca641d1 | |
| parent | 5ee61807ac868a948625b6d3d904cfde99179e15 (diff) | |
| download | thatcomputerscientist-7689596bf4582d95640386f7495d1786c67678d4.tar.xz thatcomputerscientist-7689596bf4582d95640386f7495d1786c67678d4.zip | |
Fix: Geodata not found
| -rw-r--r-- | middleware/tz.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/middleware/tz.py b/middleware/tz.py index 4aa3087a..35565834 100644 --- a/middleware/tz.py +++ b/middleware/tz.py @@ -23,7 +23,7 @@ class TimezoneMiddleware(object): remote_ip = request.META.get('REMOTE_ADDR') geo_data = requests.get(f'http://ip-api.com/json/{remote_ip}').json() - user_timezone = geo_data['timezone'] + user_timezone = geo_data['timezone'] or 'UTC' if user_timezone: response = self.get_response(request) |
