Skip to content

Commit

Permalink
Work around picture-full-path issue
Browse files Browse the repository at this point in the history
  • Loading branch information
BjarniRunar committed Aug 4, 2016
1 parent 6e2e4d5 commit a2dd48f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions vaa/questions/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ def userupdate(request):
candidate.picture = data['picture']
candidate.save()

# Work around a weird thing where the full path gets saved and
# relative things stop working. Not sure why the full path gets
# saved, we're doing something wrong somewhere... -bre
cp = candidate.picture
if cp.name.startswith(settings.MEDIA_ROOT):
cp.name = cp.name[len(settings.MEDIA_ROOT)+1:]
candidate.save()

return HttpResponseRedirect("/userpage/")


Expand Down

0 comments on commit a2dd48f

Please sign in to comment.