comparison user_photos/views.py @ 724:8b027e7a7977

Sigh, fix last commit.
author Brian Neal <bgneal@gmail.com>
date Sat, 21 Sep 2013 18:06:57 -0500
parents c0199d3d3b86
children 4f265f61874b
comparison
equal deleted inserted replaced
723:c0199d3d3b86 724:8b027e7a7977
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('Please login to use this service')
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('This method is not allowed')
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():