salopensource / sal

Modular reporting for Endpoints
Apache License 2.0
212 stars 64 forks source link

Time comparison to 'never' fails for admin update notification #304

Closed sheagcraig closed 5 years ago

sheagcraig commented 5 years ago

Describe the bug Sal UI dies trying to compare 'never' to a float epoch time.

Traceback:

File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner

  1. response = get_response(request)

File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py" in _legacy_get_response

  1. response = self._get_response(request)

File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response

  1. response = self.process_exception_by_middleware(e, request)

File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response

  1. response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/usr/local/lib/python3.6/site-packages/django/contrib/auth/decorators.py" in _wrapped_view

  1. return view_func(request, *args, **kwargs)

File "/home/docker/sal/server/views.py" in index

  1. context.update(utils.check_version())

File "/home/docker/sal/server/utils.py" in check_version

  1. if current_time > next_notify_date:

Exception Type: TypeError at / Exception Value: '>' not supported between instances of 'float' and 'str'

Example values: current_time: 1544108664.4966092 next_notify_date: 'never'

To Reproduce Steps to reproduce the behavior:

  1. Possibly not an issue on other versions; certainly an issue on the 4.0 branch...
  2. New version is available.
  3. "never" is chosen as the remind me option.
  4. Try to view something.

Expected behavior You're not nagged again until the next version and the site works correctly.

Server (please complete the following information):

sheagcraig commented 5 years ago

Fixed by #305