Skip to content

Add clean up command to delete archives

Luiz Angelo Daros de Luca requested to merge luizluca/hyperkitty:cleanup into master

A new hyperkitty_cleanup command allows the admin to delete messages, threads or lists from the archive, optionally filtering by time.

Fixes #146 (closed)

It was tested with 1.1.0 but it might work with newer versions. It breaks "most-recent" tab until the app is restarted.

File "/usr/lib/python3.6/site-packages/django/core/handlers/" in inner
  34.             response = get_response(request)

File "/usr/lib/python3.6/site-packages/django/core/handlers/" in _get_response
  115.                 response = self.process_exception_by_middleware(e, request)

File "/usr/lib/python3.6/site-packages/django/core/handlers/" in _get_response
  113.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/usr/lib/python3.6/site-packages/hyperkitty/lib/" in inner
  134.         return func(request, *args, **kwargs)

File "/usr/lib/python3.6/site-packages/hyperkitty/views/" in overview_recent_threads
  196.         'threads': mlist.recent_threads[:20],

File "/usr/lib/python3.6/site-packages/hyperkitty/models/" in recent_threads
  142.         return self.cached_values["recent_threads"]()

File "/usr/lib/python3.6/site-packages/hyperkitty/models/" in __call__
  59.         return self.get_or_set(*args, **kwargs)

File "/usr/lib/python3.6/site-packages/hyperkitty/models/" in get_or_set
  281.         return [Thread.objects.get(pk=pk) for pk in thread_ids]

File "/usr/lib/python3.6/site-packages/hyperkitty/models/" in <listcomp>
  281.         return [Thread.objects.get(pk=pk) for pk in thread_ids]

File "/usr/lib/python3.6/site-packages/django/db/models/" in manager_method
  82.                 return getattr(self.get_queryset(), name)(*args, **kwargs)

File "/usr/lib/python3.6/site-packages/django/db/models/" in get
  408.                 self.model._meta.object_name

Exception Type: DoesNotExist at /hyperkitty/list/
Exception Value: Thread matching query does not exist.
Request information:
USER: admin

Do I need to call anything else to cleanup caches?

Merge request reports