Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dropbox] Remove dead prefix removal code #1425

Merged
merged 1 commit into from
Jul 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading