use the user from the avatar instance

This commit is contained in:
Mathieu Pillard 2010-01-22 19:09:18 +01:00 committed by Eric Florenzano
parent 0b5674f008
commit 5621d867b1

View file

@ -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)