diff --git a/django_lostplaces/lostplaces/models/models.py b/django_lostplaces/lostplaces/models/models.py index d577405..5b9b986 100644 --- a/django_lostplaces/lostplaces/models/models.py +++ b/django_lostplaces/lostplaces/models/models.py @@ -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): """