From 63c865790a6e9932a7b8d5953fc57536db0e20f4 Mon Sep 17 00:00:00 2001 From: Jessica Tallon Date: Wed, 22 Oct 2014 21:42:57 +0100 Subject: [PATCH] Only create a slug after a media upload via the API when there is a title --- mediagoblin/federation/views.py | 1 + mediagoblin/submit/lib.py | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/mediagoblin/federation/views.py b/mediagoblin/federation/views.py index 4c0593fc..4dad82d6 100644 --- a/mediagoblin/federation/views.py +++ b/mediagoblin/federation/views.py @@ -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 = { diff --git a/mediagoblin/submit/lib.py b/mediagoblin/submit/lib.py index 1813aa82..ea24ec5c 100644 --- a/mediagoblin/submit/lib.py +++ b/mediagoblin/submit/lib.py @@ -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 -- 2.25.1