From: Jessica Tallon Date: Wed, 22 Oct 2014 20:42:57 +0000 (+0100) Subject: Only create a slug after a media upload via the API when there is a title X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=63c865790a6e9932a7b8d5953fc57536db0e20f4;p=mediagoblin.git Only create a slug after a media upload via the API when there is a title --- 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