Skip to content

Commit a744bd2

Browse files
committed
[dropbox] Conform to location property name
1 parent 123b9b9 commit a744bd2

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

storages/backends/dropbox.py

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# Author: Anthony Monthe <[email protected]>
33
# License: BSD
44

5-
import warnings
65
from io import BytesIO
76
from shutil import copyfileobj
87
from tempfile import SpooledTemporaryFile
@@ -79,11 +78,9 @@ def __init__(self, oauth2_access_token=None, **settings):
7978
[self.app_key, self.app_secret, self.oauth2_refresh_token]
8079
):
8180
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'."
8784
)
8885
self.client = Dropbox(
8986
self.oauth2_access_token,
@@ -92,16 +89,7 @@ def __init__(self, oauth2_access_token=None, **settings):
9289
oauth2_refresh_token=self.oauth2_refresh_token,
9390
timeout=self.timeout,
9491
)
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
10593

10694
def get_default_settings(self):
10795
return {
@@ -117,7 +105,7 @@ def get_default_settings(self):
117105
def _full_path(self, name):
118106
if name == "/":
119107
name = ""
120-
return safe_join(self.root_path, name).replace("\\", "/")
108+
return safe_join(self.location, name).replace("\\", "/")
121109

122110
def delete(self, name):
123111
self.client.files_delete(self._full_path(name))

0 commit comments

Comments
 (0)