Mercurial > public > sg101
comparison user_photos/views.py @ 723:c0199d3d3b86
Oops, last commit was returning HttpResponse* derived classes, not instances.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sat, 21 Sep 2013 17:18:34 -0500 |
parents | 71d17d267e27 |
children | 8b027e7a7977 |
comparison
equal
deleted
inserted
replaced
722:71d17d267e27 | 723:c0199d3d3b86 |
---|---|
56 If a non-200 status code is returned the response will simply be a text | 56 If a non-200 status code is returned the response will simply be a text |
57 string error message. | 57 string error message. |
58 | 58 |
59 """ | 59 """ |
60 if not request.user.is_authenticated(): | 60 if not request.user.is_authenticated(): |
61 return HttpResponseForbidden | 61 return HttpResponseForbidden() |
62 if not request.is_ajax() or request.method != 'POST': | 62 if not request.is_ajax() or request.method != 'POST': |
63 return HttpResponseNotAllowed | 63 return HttpResponseNotAllowed() |
64 | 64 |
65 ret = {'success': False, 'msg': '', 'url': ''} | 65 ret = {'success': False, 'msg': '', 'url': ''} |
66 if settings.USER_PHOTOS_ENABLED: | 66 if settings.USER_PHOTOS_ENABLED: |
67 form = UploadForm(request.POST, request.FILES, user=request.user) | 67 form = UploadForm(request.POST, request.FILES, user=request.user) |
68 if form.is_valid(): | 68 if form.is_valid(): |