DartLazer/WhoIsHomeUI

Last update bricked the script for users with existing database

Closed this issue · 5 comments

@babanomania I didn't try the last pull request before merging last night.

I'm getting the following errors leaving the tz value to default:
| Traceback (most recent call last): web_1 | File "/usr/local/lib/python3.10/wsgiref/handlers.py", line 137, in run web_1 | self.result = application(self.environ, self.start_response) web_1 | File "/usr/local/lib/python3.10/site-packages/django/contrib/staticfiles/handlers.py", line 76, in __call__ web_1 | return self.application(environ, start_response) web_1 | File "/usr/local/lib/python3.10/site-packages/django/core/handlers/wsgi.py", line 133, in __call__ web_1 | response = self.get_response(request) web_1 | File "/usr/local/lib/python3.10/site-packages/django/core/handlers/base.py", line 130, in get_response web_1 | response = self._middleware_chain(request) web_1 | File "/usr/local/lib/python3.10/site-packages/django/core/handlers/exception.py", line 49, in inner web_1 | response = response_for_exception(request, exc) web_1 | File "/usr/local/lib/python3.10/site-packages/django/core/handlers/exception.py", line 114, in response_for_exception web_1 | response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info()) web_1 | File "/usr/local/lib/python3.10/site-packages/django/core/handlers/exception.py", line 149, in handle_uncaught_exception web_1 | return debug.technical_500_response(request, *exc_info) web_1 | File "/usr/local/lib/python3.10/site-packages/django/views/debug.py", line 57, in technical_500_response web_1 | html = reporter.get_traceback_html() web_1 | File "/usr/local/lib/python3.10/site-packages/django/views/debug.py", line 346, in get_traceback_html web_1 | return t.render(c) web_1 | File "/usr/local/lib/python3.10/site-packages/django/template/base.py", line 170, in render web_1 | return self._render(context) web_1 | File "/usr/local/lib/python3.10/site-packages/django/template/base.py", line 162, in _render web_1 | return self.nodelist.render(context) web_1 | File "/usr/local/lib/python3.10/site-packages/django/template/base.py", line 938, in render web_1 | bit = node.render_annotated(context) web_1 | File "/usr/local/lib/python3.10/site-packages/django/template/base.py", line 905, in render_annotated web_1 | return self.render(context) web_1 | File "/usr/local/lib/python3.10/site-packages/django/template/base.py", line 988, in render web_1 | output = self.filter_expression.resolve(context) web_1 | File "/usr/local/lib/python3.10/site-packages/django/template/base.py", line 694, in resolve web_1 | obj = template_localtime(obj, context.use_tz) web_1 | File "/usr/local/lib/python3.10/site-packages/django/utils/timezone.py", line 158, in template_localtime web_1 | return localtime(value) if should_convert else value web_1 | File "/usr/local/lib/python3.10/site-packages/django/utils/timezone.py", line 176, in localtime web_1 | timezone = get_current_timezone() web_1 | File "/usr/local/lib/python3.10/site-packages/django/utils/timezone.py", line 66, in get_current_timezone web_1 | return getattr(_active, "value", get_default_timezone()) web_1 | File "/usr/local/lib/python3.10/site-packages/django/utils/timezone.py", line 52, in get_default_timezone web_1 | return pytz.timezone(settings.TIME_ZONE) web_1 | File "/usr/local/lib/python3.10/site-packages/pytz/__init__.py", line 188, in timezone web_1 | raise UnknownTimeZoneError(zone) web_1 | pytz.exceptions.UnknownTimeZoneError: ''

I have to go to work at the moment. Could you have a look what is causing this? @babanomania

The error occurs when using my old db file @babanomania

commenting out line 151 in mysite/mysite/settings.py is a quick bugfix for now
os.environ.get('DJANGO_TZ', 'Europe/Amsterdam')

The code is failing due to blank timezone, according to the below line in the error log

pytz.exceptions.UnknownTimeZoneError: ''

Unfortunately i'm not able to replicate this.
Assuming, you're also running via docker. can you check by creating .env file in the same path as docker-compose.yml

WHOIH_TZ=Europe/Amsterdam
WHOIH_PORT=8000

Yes that fixed it indeed. Should we include the env file?

Fixed with v0.19