Skip to content

Commit

Permalink
Use storage APIs in OverwriteStorage
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanw committed Jan 28, 2025
1 parent ef2c630 commit f827bcb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions froide/helper/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ def sha256(file):


class OverwriteStorage(FileSystemStorage):
# TODO: Remove in Django 5.1 in favour of allow_overwrite option
def get_available_name(self, name, max_length=None):
# FIXME: max_length is ignored
# If the filename already exists, remove it as if it was a true file system
if self.exists(name):
full_path = self.path(name)
os.remove(full_path)
self.delete(name)
return name


Expand Down

0 comments on commit f827bcb

Please sign in to comment.