From b1db2c2e744dc0e5fcd10b53792c6ce306fc7149 Mon Sep 17 00:00:00 2001 From: Caleb Forbes Davis V Date: Tue, 5 Jul 2011 21:40:00 -0500 Subject: [PATCH] slug-style urls in previous and next urls look much better Bug #434 - identifies media by slug instead of _id in prev/next --- mediagoblin/db/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mediagoblin/db/models.py b/mediagoblin/db/models.py index 8aa35ca9..c7506dbb 100644 --- a/mediagoblin/db/models.py +++ b/mediagoblin/db/models.py @@ -154,7 +154,7 @@ class MediaEntry(Document): if cursor.count(): return urlgen('mediagoblin.user_pages.media_home', user=self.uploader()['username'], - media=unicode(cursor[0]['_id'])) + media=unicode(cursor[0]['slug'])) def url_to_next(self, urlgen): """ @@ -167,7 +167,7 @@ class MediaEntry(Document): if cursor.count(): return urlgen('mediagoblin.user_pages.media_home', user=self.uploader()['username'], - media=unicode(cursor[0]['_id'])) + media=unicode(cursor[0]['slug'])) def uploader(self): return self.db.User.find_one({'_id': self['uploader']}) -- 2.25.1