mirror of
https://github.com/jazzband/django-avatar.git
synced 2026-03-16 22:20:30 +00:00
use the user from the avatar instance
This commit is contained in:
parent
0b5674f008
commit
5621d867b1
1 changed files with 1 additions and 1 deletions
|
|
@ -21,7 +21,7 @@ from avatar import AVATAR_STORAGE_DIR, AVATAR_RESIZE_METHOD, \
|
|||
|
||||
|
||||
def avatar_file_path(instance=None, filename=None):
|
||||
return os.path.join(AVATAR_STORAGE_DIR, user.username, filename)
|
||||
return os.path.join(AVATAR_STORAGE_DIR, instance.user.username, filename)
|
||||
|
||||
class Avatar(models.Model):
|
||||
user = models.ForeignKey(User)
|
||||
|
|
|
|||
Loading…
Reference in a new issue