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

TimeseriesGroup matching query does not exist #435

Closed aptiko closed 3 years ago

aptiko commented 3 years ago
Internal Server Error: /admin/enhydris/station/2212/delete/

DoesNotExist at /admin/enhydris/station/2212/delete/
TimeseriesGroup matching query does not exist.

Traceback:

File "/opt/enhydris-openhi/venv/lib/python3.7/site-packages/django/db/models/fields/related_descriptors.py" in __get__
  164.             rel_obj = self.field.get_cached_value(instance)

File "/opt/enhydris-openhi/venv/lib/python3.7/site-packages/django/db/models/fields/mixins.py" in get_cached_value
  13.             return instance._state.fields_cache[cache_name]

During handling of the above exception ('timeseries_group'), another exception occurred:

File "/opt/enhydris-openhi/venv/lib/python3.7/site-packages/django/core/handlers/exception.py" in inner
  34.             response = get_response(request)

File "/opt/enhydris-openhi/venv/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
  115.                 response = self.process_exception_by_middleware(e, request)

File "/opt/enhydris-openhi/venv/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
  113.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/opt/enhydris-openhi/venv/lib/python3.7/site-packages/django/contrib/admin/options.py" in wrapper
  606.                 return self.admin_site.admin_view(view)(*args, **kwargs)

File "/opt/enhydris-openhi/venv/lib/python3.7/site-packages/django/utils/decorators.py" in _wrapped_view
  142.                     response = view_func(request, *args, **kwargs)

File "/opt/enhydris-openhi/venv/lib/python3.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  44.         response = view_func(request, *args, **kwargs)

File "/opt/enhydris-openhi/venv/lib/python3.7/site-packages/django/contrib/admin/sites.py" in inner
  223.             return view(request, *args, **kwargs)

File "/opt/enhydris-openhi/venv/lib/python3.7/site-packages/django/utils/decorators.py" in _wrapper
  45.         return bound_method(*args, **kwargs)

File "/opt/enhydris-openhi/venv/lib/python3.7/site-packages/django/utils/decorators.py" in _wrapped_view
  142.                     response = view_func(request, *args, **kwargs)

File "/opt/enhydris-openhi/venv/lib/python3.7/site-packages/django/contrib/admin/options.py" in delete_view
  1825.             return self._delete_view(request, object_id, extra_context)

File "/opt/enhydris-openhi/venv/lib/python3.7/site-packages/django/contrib/admin/options.py" in _delete_view
  1846.         deleted_objects, model_count, perms_needed, protected = self.get_deleted_objects([obj], request)

File "/opt/enhydris-openhi/venv/lib/python3.7/site-packages/django/contrib/admin/options.py" in get_deleted_objects
  1820.         return get_deleted_objects(objs, request, self.admin_site)

File "/opt/enhydris-openhi/venv/lib/python3.7/site-packages/django/contrib/admin/utils.py" in get_deleted_objects
  151.     to_delete = collector.nested(format_callback)

File "/opt/enhydris-openhi/venv/lib/python3.7/site-packages/django/contrib/admin/utils.py" in nested
  211.             roots.extend(self._nested(root, seen, format_callback))

File "/opt/enhydris-openhi/venv/lib/python3.7/site-packages/django/contrib/admin/utils.py" in _nested
  195.             children.extend(self._nested(child, seen, format_callback))

File "/opt/enhydris-openhi/venv/lib/python3.7/site-packages/django/contrib/admin/utils.py" in _nested
  195.             children.extend(self._nested(child, seen, format_callback))

File "/opt/enhydris-openhi/venv/lib/python3.7/site-packages/django/contrib/admin/utils.py" in _nested
  195.             children.extend(self._nested(child, seen, format_callback))

File "/opt/enhydris-openhi/venv/lib/python3.7/site-packages/django/contrib/admin/utils.py" in _nested
  197.             ret = [format_callback(obj)]

File "/opt/enhydris-openhi/venv/lib/python3.7/site-packages/django/contrib/admin/utils.py" in format_callback
  126.         no_edit_link = '%s: %s' % (capfirst(opts.verbose_name), obj)

File "/opt/enhydris-openhi/enhydris/models.py" in __str__
  898.         tzinfo = self.timeseries.timeseries_group.time_zone.as_tzinfo

File "/opt/enhydris-openhi/venv/lib/python3.7/site-packages/django/db/models/fields/related_descriptors.py" in __get__
  178.                 rel_obj = self.get_object(instance)

File "/opt/enhydris-openhi/venv/lib/python3.7/site-packages/django/db/models/fields/related_descriptors.py" in get_object
  145.         return qs.get(self.field.get_reverse_related_filter(instance))

File "/opt/enhydris-openhi/venv/lib/python3.7/site-packages/django/db/models/query.py" in get
  408.                 self.model._meta.object_name

Exception Type: DoesNotExist at /admin/enhydris/station/2212/delete/
Exception Value: TimeseriesGroup matching query does not exist.
Request information:
USER: romanos_04

GET:
_changelist_filters = 'q=demo'

POST: No POST data

FILES: No FILES data
aptiko commented 3 years ago

Can't reproduce, and I also can't understand why it should occur.