Hi Folks, Just recently I've started seeing backtraces from Django when trying to view old threads in hyperkitty. They say that more than one LastView is being returned, and at a later date cannot delete a LastView.
I'm using the Debian-packaged hyperkitty and postorius, but this code hasn't changed from upstream.
The backtraces come when a logged in used revisits a thread.
So I see:
Internal Server Error: /hyperkitty/list/devel@sel4.systems/thread/XP2GFYGXOXBC3QBKKZQLZ6STSHQHK6K2/
MultipleObjectsReturned at /hyperkitty/list/devel@sel4.systems/thread/XP2GFYGXOXBC3QBKKZQLZ6STSHQHK6K2/ get() returned more than one LastView -- it returned 2!
Then later on I see: LastView.objects.delete(pk=del_id) ^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'Manager' object has no attribute 'delete'
Here are the backtraces:
Traceback (most recent call last): File "/usr/lib/python3/dist-packages/django/core/handlers/exception.py", line 47, in inner response = get_response(request) File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 181, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/usr/lib/python3/dist-packages/hyperkitty/lib/view_helpers.py", line 137, in inner return func(request, *args, **kwargs) File "/usr/lib/python3/dist-packages/hyperkitty/views/thread.py", line 162, in thread_index last_view_obj, created = LastView.objects.get_or_create( File "/usr/lib/python3/dist-packages/django/db/models/manager.py", line 85, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/usr/lib/python3/dist-packages/django/db/models/query.py", line 581, in get_or_create return self.get(**kwargs), False File "/usr/lib/python3/dist-packages/django/db/models/query.py", line 439, in get raise self.model.MultipleObjectsReturned(
and
Internal Server Error: /hyperkitty/list/devel@sel4.systems/2022/1/
AttributeError at /hyperkitty/list/devel@sel4.systems/2022/1/ 'Manager' object has no attribute 'delete'
Traceback (most recent call last): File "/usr/lib/python3/dist-packages/django/core/handlers/exception.py", line 47, in inner response = get_response(request) File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 181, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/usr/lib/python3/dist-packages/hyperkitty/lib/view_helpers.py", line 137, in inner return func(request, *args, **kwargs) File "/usr/lib/python3/dist-packages/hyperkitty/views/mlist.py", line 127, in archives return _thread_list(request, mlist, threads, extra_context=extra_context) File "/usr/lib/python3/dist-packages/hyperkitty/views/mlist.py", line 173, in _thread_list LastView.objects.delete(pk=del_id)