Fix some media page redirects in media_collect.
authorElrond <elrond+mediagoblin.org@samba-tng.org>
Fri, 1 Mar 2013 13:45:20 +0000 (14:45 +0100)
committerElrond <elrond+mediagoblin.org@samba-tng.org>
Fri, 1 Mar 2013 21:08:24 +0000 (22:08 +0100)
Use .slug_or_id instead of only .id.

mediagoblin/user_pages/views.py

index 6f8f805916ebfd637e8ae354f189126a9e6583c6..69d7defbc28e7916f0d60ad436261e37c732db5e 100644 (file)
@@ -214,8 +214,8 @@ def media_collect(request, media):
                 _('You already have a collection called "%s"!')
                 % existing_collection.title)
             return redirect(request, "mediagoblin.user_pages.media_home",
-                            user=request.user.username,
-                            media=media.id)
+                            user=media.get_uploader.username,
+                            media=media.slug_or_id)
 
         collection = Collection()
         collection.title = request.form['collection_title']
@@ -266,7 +266,7 @@ def media_collect(request, media):
 
     return redirect(request, "mediagoblin.user_pages.media_home",
                     user=media.get_uploader.username,
-                    media=media.id)
+                    media=media.slug_or_id)
 
 
 #TODO: Why does @user_may_delete_media not implicate @require_active_login?