9
9
from django .core .exceptions import ImproperlyConfigured
10
10
from django .core .files .storage import FileSystemStorage , Storage , default_storage
11
11
from django .utils ._os import safe_join
12
- from django .utils .deprecation import RemovedInDjango60Warning
12
+ from django .utils .deprecation import RemovedInDjango61Warning
13
13
from django .utils .functional import LazyObject , empty
14
14
from django .utils .module_loading import import_string
15
15
16
16
# To keep track on which directories the finder has searched the static files.
17
17
searched_locations = []
18
18
19
19
20
- # RemovedInDjango60Warning : When the deprecation ends, remove completely.
20
+ # RemovedInDjango61Warning : When the deprecation ends, remove completely.
21
21
def _check_deprecated_find_param (class_name = "" , find_all = False , ** kwargs ):
22
22
method_name = "find" if not class_name else f"{ class_name } .find"
23
23
if "all" in kwargs :
@@ -26,7 +26,7 @@ def _check_deprecated_find_param(class_name="", find_all=False, **kwargs):
26
26
"Passing the `all` argument to find() is deprecated. Use `find_all` "
27
27
"instead."
28
28
)
29
- warnings .warn (msg , RemovedInDjango60Warning , stacklevel = 2 )
29
+ warnings .warn (msg , RemovedInDjango61Warning , stacklevel = 2 )
30
30
31
31
# If both `find_all` and `all` were given, raise TypeError.
32
32
if find_all is not False :
@@ -54,13 +54,13 @@ def check(self, **kwargs):
54
54
"configured correctly."
55
55
)
56
56
57
- # RemovedInDjango60Warning : When the deprecation ends, remove completely.
57
+ # RemovedInDjango61Warning : When the deprecation ends, remove completely.
58
58
def _check_deprecated_find_param (self , ** kwargs ):
59
59
return _check_deprecated_find_param (
60
60
class_name = self .__class__ .__qualname__ , ** kwargs
61
61
)
62
62
63
- # RemovedInDjango60Warning : When the deprecation ends, replace with:
63
+ # RemovedInDjango61Warning : When the deprecation ends, replace with:
64
64
# def find(self, path, find_all=False):
65
65
def find (self , path , find_all = False , ** kwargs ):
66
66
"""
@@ -149,13 +149,13 @@ def check(self, **kwargs):
149
149
)
150
150
return errors
151
151
152
- # RemovedInDjango60Warning : When the deprecation ends, replace with:
152
+ # RemovedInDjango61Warning : When the deprecation ends, replace with:
153
153
# def find(self, path, find_all=False):
154
154
def find (self , path , find_all = False , ** kwargs ):
155
155
"""
156
156
Look for files in the extra locations as defined in STATICFILES_DIRS.
157
157
"""
158
- # RemovedInDjango60Warning .
158
+ # RemovedInDjango61Warning .
159
159
if kwargs :
160
160
find_all = self ._check_deprecated_find_param (find_all = find_all , ** kwargs )
161
161
matches = []
@@ -232,13 +232,13 @@ def list(self, ignore_patterns):
232
232
for path in utils .get_files (storage , ignore_patterns ):
233
233
yield path , storage
234
234
235
- # RemovedInDjango60Warning : When the deprecation ends, replace with:
235
+ # RemovedInDjango61Warning : When the deprecation ends, replace with:
236
236
# def find(self, path, find_all=False):
237
237
def find (self , path , find_all = False , ** kwargs ):
238
238
"""
239
239
Look for files in the app directories.
240
240
"""
241
- # RemovedInDjango60Warning .
241
+ # RemovedInDjango61Warning .
242
242
if kwargs :
243
243
find_all = self ._check_deprecated_find_param (find_all = find_all , ** kwargs )
244
244
matches = []
@@ -287,13 +287,13 @@ def __init__(self, storage=None, *args, **kwargs):
287
287
self .storage = self .storage ()
288
288
super ().__init__ (* args , ** kwargs )
289
289
290
- # RemovedInDjango60Warning : When the deprecation ends, replace with:
290
+ # RemovedInDjango61Warning : When the deprecation ends, replace with:
291
291
# def find(self, path, find_all=False):
292
292
def find (self , path , find_all = False , ** kwargs ):
293
293
"""
294
294
Look for files in the default file storage, if it's local.
295
295
"""
296
- # RemovedInDjango60Warning .
296
+ # RemovedInDjango61Warning .
297
297
if kwargs :
298
298
find_all = self ._check_deprecated_find_param (find_all = find_all , ** kwargs )
299
299
try :
@@ -336,7 +336,7 @@ def __init__(self, *args, **kwargs):
336
336
)
337
337
338
338
339
- # RemovedInDjango60Warning : When the deprecation ends, replace with:
339
+ # RemovedInDjango61Warning : When the deprecation ends, replace with:
340
340
# def find(path, find_all=False):
341
341
def find (path , find_all = False , ** kwargs ):
342
342
"""
@@ -345,7 +345,7 @@ def find(path, find_all=False, **kwargs):
345
345
If ``find_all`` is ``False`` (default), return the first matching
346
346
absolute path (or ``None`` if no match). Otherwise return a list.
347
347
"""
348
- # RemovedInDjango60Warning .
348
+ # RemovedInDjango61Warning .
349
349
if kwargs :
350
350
find_all = _check_deprecated_find_param (find_all = find_all , ** kwargs )
351
351
searched_locations [:] = []
0 commit comments