Commit 7d6db1c4 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg

Always save profile image to save filename for user

parent 225b061f
......@@ -190,6 +190,10 @@ class Member(User):
return reverse('members:profile', args=[str(self.pk)])
def _profile_image_path(instance, filename):
return f'public/avatars/{instance.pk}'
class Profile(models.Model):
"""This class holds extra information about a member"""
......@@ -364,7 +368,7 @@ class Profile(models.Model):
photo = models.ImageField(
verbose_name=_('Photo'),
upload_to='public/avatars/',
upload_to=_profile_image_path,
null=True,
blank=True,
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment