mirror of
https://github.com/jazzband/django-avatar.git
synced 2026-05-22 14:21:51 +00:00
stopped using reserved keyword dir
This commit is contained in:
parent
d23542f880
commit
e52ecc6ed5
1 changed files with 2 additions and 2 deletions
|
|
@ -132,8 +132,8 @@ class Avatar(models.Model):
|
|||
# iterate through resized avatars directories and delete resized avatars
|
||||
resized_path = os.path.join(path, 'resized')
|
||||
resized_avatar_dirs, _ = self.avatar.storage.listdir(resized_path)
|
||||
for dir in resized_avatar_dirs:
|
||||
resized_filepath = os.path.join(resized_path, dir, filename)
|
||||
for resized_avatar_dir in resized_avatar_dirs:
|
||||
resized_filepath = os.path.join(resized_path, resized_avatar_dir, filename)
|
||||
# FileSystemStorage.delete() will not raise an exception if file does not exist.
|
||||
self.avatar.storage.delete(resized_filepath)
|
||||
super(Avatar, self).delete(*args, **kwargs)
|
||||
|
|
|
|||
Loading…
Reference in a new issue