Skip to content

Commit bdbe57d

Browse files
committed
Storing the original on module level.
1 parent ebc16cb commit bdbe57d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

debug_toolbar/panels/staticfiles.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ def url(self, path):
7575

7676
self._wrapped = DebugStaticFilesStorage(collector)
7777

78+
_original_storage = storage.staticfiles_storage
79+
7880

7981
class StaticFilesPanel(panels.Panel):
8082
"""
@@ -94,11 +96,10 @@ def __init__(self, *args, **kwargs):
9496
self._paths = {}
9597

9698
def enable_instrumentation(self):
97-
self._unpatched_staticfiles_storage = storage.staticfiles_storage
9899
storage.staticfiles_storage = staticfiles.staticfiles_storage = DebugConfiguredStorage()
99100

100101
def disable_instrumentation(self):
101-
storage.staticfiles_storage = staticfiles.staticfiles_storage = self._unpatched_staticfiles_storage
102+
storage.staticfiles_storage = staticfiles.staticfiles_storage = _original_storage
102103

103104
@property
104105
def has_content(self):

0 commit comments

Comments
 (0)