Skip to content

Commit

Permalink
[dropbox] Remove dead prefix removal code (#1425)
Browse files Browse the repository at this point in the history
  • Loading branch information
jschneier authored Jul 8, 2024
1 parent 855e58d commit cd42c17
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions storages/backends/dropbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@ class DropboxStorageException(Exception):
DropBoxStorageException = DropboxStorageException


def removeprefix(prefix, name):
if name.startswith(prefix):
name = name[len(prefix) :]
return name


class DropboxFile(File):
def __init__(self, name, storage):
self.name = name
Expand Down Expand Up @@ -176,10 +170,7 @@ def _save(self, name, content):
else:
self._chunked_upload(content, self._full_path(name))
content.close()
# .save() validates the filename isn't absolute but Dropbox requires an
# absolute filename. Work with the absolute name internally but strip it
# off before passing up-the-chain.
return removeprefix(self.root_path, name).lstrip("/")
return name

def _chunked_upload(self, content, dest_path):
upload_session = self.client.files_upload_session_start(
Expand Down

0 comments on commit cd42c17

Please sign in to comment.