Fixed filename generation.

This commit is contained in:
Marcus Scholz 2020-12-24 18:14:40 +01:00
parent a9013d9673
commit d5827b2006

View File

@ -27,7 +27,7 @@ def generate_profile_image_filename(instance, filename):
Returns filename as: explorer_pk-username.jpg
"""
return 'explorers/' + str(instance.explorer.pk) + '-' + str(instance.explorer.username) + '.' + filename.split('.')[-1]
return 'explorers/' + str(instance.user.pk) + '-' + str(instance.user.username) + '.' + filename.split('.')[-1]
class Explorer(models.Model):
"""