2
2
# Author: Anthony Monthe <[email protected] >
3
3
# License: BSD
4
4
5
- import warnings
6
5
from io import BytesIO
7
6
from shutil import copyfileobj
8
7
from tempfile import SpooledTemporaryFile
@@ -79,11 +78,9 @@ def __init__(self, oauth2_access_token=None, **settings):
79
78
[self .app_key , self .app_secret , self .oauth2_refresh_token ]
80
79
):
81
80
raise ImproperlyConfigured (
82
- "You must configure an auth token at"
83
- "'settings.DROPBOX_OAUTH2_TOKEN' or "
84
- "'setting.DROPBOX_APP_KEY', "
85
- "'setting.DROPBOX_APP_SECRET' "
86
- "and 'setting.DROPBOX_OAUTH2_REFRESH_TOKEN'."
81
+ "You must configure an auth token at 'settings.DROPBOX_OAUTH2_TOKEN' "
82
+ "or 'setting.DROPBOX_APP_KEY', 'setting.DROPBOX_APP_SECRET' and "
83
+ "'setting.DROPBOX_OAUTH2_REFRESH_TOKEN'."
87
84
)
88
85
self .client = Dropbox (
89
86
self .oauth2_access_token ,
@@ -92,16 +89,7 @@ def __init__(self, oauth2_access_token=None, **settings):
92
89
oauth2_refresh_token = self .oauth2_refresh_token ,
93
90
timeout = self .timeout ,
94
91
)
95
-
96
- # Backwards compat
97
- if hasattr (self , "location" ):
98
- warnings .warn (
99
- "Setting `root_path` with name `location` is deprecated and will be "
100
- "removed in a future version of django-storages. Please update the "
101
- "name from `location` to `root_path`" ,
102
- DeprecationWarning ,
103
- )
104
- self .root_path = self .location
92
+ self .location = self .root_path
105
93
106
94
def get_default_settings (self ):
107
95
return {
@@ -117,7 +105,7 @@ def get_default_settings(self):
117
105
def _full_path (self , name ):
118
106
if name == "/" :
119
107
name = ""
120
- return safe_join (self .root_path , name ).replace ("\\ " , "/" )
108
+ return safe_join (self .location , name ).replace ("\\ " , "/" )
121
109
122
110
def delete (self , name ):
123
111
self .client .files_delete (self ._full_path (name ))
0 commit comments