Skip to content

Remove content type lookup when clearing cached values #13544

@abhi1693

Description

@abhi1693

Proposed Changes

index 9a29c54f5..e072c220a 100644
--- a/netbox/extras/management/commands/reindex.py
+++ b/netbox/extras/management/commands/reindex.py
@@ -69,10 +69,7 @@ class Command(BaseCommand):
         if not kwargs['lazy']:
             self.stdout.write('Clearing cached values... ', ending='')
             self.stdout.flush()
-            content_types = [
-                ContentType.objects.get_for_model(model) for model in indexers.keys()
-            ]
-            deleted_count = search_backend.clear(content_types)
+            deleted_count = search_backend.clear()
             self.stdout.write(f'{deleted_count} entries deleted.')

Justification

When trying to debug the issue for #13507, I wanted to clear my existing cache so I ran ./manage.py reindex expecting all values to be removed including any plugins that have been uninstalled. However, that was not the case and my search was still broken as the plugin values still existed within CacheValue

Metadata

Metadata

Assignees

Labels

severity: lowDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions