Fix problem where feed posting wasn't returning correct object
authorJessica Tallon <jessica@megworld.co.uk>
Mon, 7 Apr 2014 16:09:08 +0000 (11:09 -0500)
committerJessica Tallon <jessica@megworld.co.uk>
Tue, 22 Jul 2014 22:13:15 +0000 (23:13 +0100)
mediagoblin/federation/views.py

index 7107f4bcc63f7524176f727831da1abb5e245007..1e8c3e14bd4238ed5b71707707af3bdb540c91da 100644 (file)
@@ -1,3 +1,4 @@
+
 import json
 import io
 import mimetypes
@@ -72,9 +73,9 @@ def uploads(request):
         if hasattr(media_manager, "api_upload_request"):
             return media_manager.api_upload_request(request, file_data, entry)
         else:
-            return json_response({"error": "Not yet implemented"}, status=400)
+            return json_response({"error": "Not yet implemented"}, status=501)
 
-    return json_response({"error": "Not yet implemented"}, status=400)
+    return json_response({"error": "Not yet implemented"}, status=501)
 
 @oauth_required
 @csrf_exempt
@@ -120,7 +121,10 @@ def feed(request):
                 error = "No such 'image' with id '{0}'".format(id=media_id)
                 return json_response(error, status=404)
             media = media[0]
-            return json_response(media.serialize(request))
+            return json_response({
+                "verb": "post",
+                "object": media.serialize(request)
+            })
 
         elif obj.get("objectType", None) is None:
             # They need to tell us what type of object they're giving us.