mirror of
https://github.com/jazzband/django-avatar.git
synced 2026-03-16 22:20:30 +00:00
Make sure to make the directories before uploading, too.
git-svn-id: http://django-avatar.googlecode.com/svn/trunk@10 c76b2324-5f53-0410-85ac-b1078a54aeeb
This commit is contained in:
parent
b329ef276f
commit
5b3da03bce
1 changed files with 1 additions and 0 deletions
|
|
@ -95,6 +95,7 @@ def img(request, email_hash, resize_method=Image.ANTIALIAS):
|
|||
def change(request, extra_context={}, next_override=None):
|
||||
if request.method == "POST":
|
||||
dirname = os.path.join(settings.MEDIA_ROOT, 'avatars')
|
||||
os.makedirs(dirname)
|
||||
filename = "%s.jpg" % request.user.avatar.email_hash
|
||||
full_filename = os.path.join(dirname, filename)
|
||||
(destination, destination_path) = tempfile.mkstemp()
|
||||
|
|
|
|||
Loading…
Reference in a new issue