Only create a slug after a media upload via the API when there is a title
authorJessica Tallon <jessica@megworld.co.uk>
Wed, 22 Oct 2014 20:42:57 +0000 (21:42 +0100)
committerJessica Tallon <jessica@megworld.co.uk>
Wed, 22 Oct 2014 20:42:57 +0000 (21:42 +0100)
mediagoblin/federation/views.py
mediagoblin/submit/lib.py

index 4c0593fca433d18c7b90fa27e173c81b39cfcc55..4dad82d648cc3a26c46bb3bd79ffb8adaf4da74d 100644 (file)
@@ -301,6 +301,7 @@ def feed_endpoint(request):
                     return json_error(
                         "Invalid 'image' with id '{0}'".format(obj_id)
                     )
+                image.generate_slug()
                 image.save()
 
                 activity = {
index 1813aa82da201efcde4d28378badc20abacce3c1..ea24ec5cf5fc45ca0f040f64600b356d1c5886fe 100644 (file)
@@ -286,9 +286,6 @@ def api_upload_request(request, file_data, entry):
 
 def api_add_to_feed(request, entry):
     """ Add media to Feed """
-    if entry.title:
-        entry.generate_slug()
-
     feed_url = request.urlgen(
         'mediagoblin.user_pages.atom_feed',
         qualified=True, user=request.user.username