From c8ecfa0b148bfea10e982a3fe4079efec7e92c15 Mon Sep 17 00:00:00 2001 From: Brian Tiemann Date: Fri, 6 Dec 2024 23:54:20 -0500 Subject: [PATCH] Clear Swagger API cache on startup --- netbox/core/apps.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/netbox/core/apps.py b/netbox/core/apps.py index 1dfc7a65e..c5051e922 100644 --- a/netbox/core/apps.py +++ b/netbox/core/apps.py @@ -1,4 +1,5 @@ from django.apps import AppConfig +from django.core.cache import cache from django.db import models from django.db.migrations.operations import AlterModelOptions @@ -22,3 +23,6 @@ class CoreConfig(AppConfig): # Register models register_models(*self.get_models()) + + # Clear Swagger API cache on startup + cache.delete("*api_schema_*")