1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Merge pull request #9256 from kkthxbye-code/fix-9122

Fix #9122 - Clear the cache when running the upgrade script
This commit is contained in:
Jeremy Stretch
2022-05-04 14:03:48 -04:00
committed by GitHub
2 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,11 @@
from django.core.cache import cache
from django.core.management.base import BaseCommand
class Command(BaseCommand):
"""Command to clear the entire cache."""
help = 'Clears the cache.'
def handle(self, *args, **kwargs):
cache.clear()
self.stdout.write('Cache has been cleared.', ending="\n")