openmeteo / enhydris

A database with a web interface for the storage and management of hydro/meteorological measurements and time series
GNU Affero General Public License v3.0
18 stars 11 forks source link

Cannot register time series group without name #486

Closed aptiko closed 1 year ago

aptiko commented 1 year ago

Steps to reproduce:

  1. Go to the admin and edit a station.
  2. Create a new time series group without specifying a name.
  3. Click "Save and continue editing".

Result:

Traceback (most recent call last):
  File "/opt/enhydris-openmedsal/venv/lib/python3.10/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/opt/enhydris-openmedsal/venv/lib/python3.10/site-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/enhydris-openmedsal/venv/lib/python3.10/site-packages/django/contrib/admin/options.py", line 616, in wrapper
    return self.admin_site.admin_view(view)(*args, **kwargs)
  File "/opt/enhydris-openmedsal/venv/lib/python3.10/site-packages/django/utils/decorators.py", line 130, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/opt/enhydris-openmedsal/venv/lib/python3.10/site-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/opt/enhydris-openmedsal/venv/lib/python3.10/site-packages/django/contrib/admin/sites.py", line 232, in inner
    return view(request, *args, **kwargs)
  File "/opt/enhydris-openmedsal/venv/lib/python3.10/site-packages/django/contrib/admin/options.py", line 1660, in change_view
    return self.changeform_view(request, object_id, form_url, extra_context)
  File "/opt/enhydris-openmedsal/venv/lib/python3.10/site-packages/django/utils/decorators.py", line 43, in _wrapper
    return bound_method(*args, **kwargs)
  File "/opt/enhydris-openmedsal/venv/lib/python3.10/site-packages/django/utils/decorators.py", line 130, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/opt/enhydris-openmedsal/venv/lib/python3.10/site-packages/django/contrib/admin/options.py", line 1540, in changeform_view
    return self._changeform_view(request, object_id, form_url, extra_context)
  File "/opt/enhydris-openmedsal/venv/lib/python3.10/site-packages/django/contrib/admin/options.py", line 1588, in _changeform_view
    change_message = self.construct_change_message(request, form, formsets, add)
  File "/opt/enhydris-openmedsal/venv/lib/python3.10/site-packages/django/contrib/admin/options.py", line 1061, in construct_change_message
    return construct_change_message(form, formsets, add)
  File "/opt/enhydris-openmedsal/venv/lib/python3.10/site-packages/django/contrib/admin/utils.py", line 522, in construct_change_message
    'object': str(added_object),

Exception Type: TypeError at /admin/enhydris/station/2012/change/
Exception Value: __str__ returned non-string (type NoneType)
Request information:
USER: aptiko
aptiko commented 1 year ago

This is very strange. I can't reproduce it either. Maybe it was something else and I didn't describe it correctly. Go figure. Until we re-discover it, I'm closing the issue.