Periodic field updates run for trashed tables
The periodic update code fails to filter out trashed tables/databases when it runs. This is somewhat harmless however now we also trigger a search update task which then correctly crashes as it was given a trashed table to update for.
Fix is probably:
Index: backend/src/baserow/contrib/database/fields/tasks.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/backend/src/baserow/contrib/database/fields/tasks.py b/backend/src/baserow/contrib/database/fields/tasks.py
--- a/backend/src/baserow/contrib/database/fields/tasks.py (revision e5935dd390506f29900cedded510d906c9cee515)
+++ b/backend/src/baserow/contrib/database/fields/tasks.py (date 1689775348864)
@@ -27,7 +27,9 @@
"""
queryset = Workspace.objects.filter(
- application__database__table__field__in=queryset
+ application__database__table__field__in=queryset,
+ application__trashed=False,
+ application__database__table__trashed=False,
)
if workspace_id is not None:
queryset = queryset.filter(id=workspace_id)
@@ -72,7 +74,11 @@
workspace.refresh_now()
add_baserow_trace_attrs(update_now=update_now, workspace_id=workspace.id)
- for field in qs.filter(table__database__workspace_id=workspace.id):
+ for field in qs.filter(
+ table__database__workspace_id=workspace.id,
+ table__trashed=False,
+ database__trashed=False,
+ ):
# noinspection PyBroadException
try:
_run_periodic_field_update(field, field_type_instance)