Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
thalia
concrexit
Commits
7d6db1c4
Verified
Commit
7d6db1c4
authored
Sep 04, 2019
by
Sébastiaan Versteeg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always save profile image to save filename for user
parent
225b061f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
website/members/models.py
website/members/models.py
+5
-1
No files found.
website/members/models.py
View file @
7d6db1c4
...
...
@@ -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
,
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment