diff user_photos/views.py @ 972:7138883966b3

Started unit tests for hotlinking images.
author Brian Neal <bgneal@gmail.com>
date Wed, 23 Sep 2015 21:26:09 -0500
parents 4f265f61874b
children d9cd3180c12c
line wrap: on
line diff
--- a/user_photos/views.py	Tue Sep 22 20:23:50 2015 -0500
+++ b/user_photos/views.py	Wed Sep 23 21:26:09 2015 -0500
@@ -156,13 +156,13 @@
 
     if not request.user.is_authenticated():
         ret['error_msg'] = 'Please login to use this service'
-        return JsonResponse(ret, status=status_code)
+        return JsonResponse(ret, status=403)
     if not request.is_ajax() or request.method != 'POST':
         ret['error_msg'] = 'This method is not allowed'
-        return JsonResponse(ret, status=status_code)
+        return JsonResponse(ret, status=405)
 
     if settings.USER_PHOTOS_ENABLED:
-        form = HotLinkImageForm(request.POST, request.FILES, user=request.user)
+        form = HotLinkImageForm(request.POST, user=request.user)
         if form.is_valid():
             try:
                 ret['url'] = form.save()