diff options
author | Caleb Forbes Davis V <caldavis@gmail.com> | 2011-07-05 21:40:00 -0500 |
---|---|---|
committer | Caleb Forbes Davis V <caldavis@gmail.com> | 2011-07-05 21:40:00 -0500 |
commit | b1db2c2e744dc0e5fcd10b53792c6ce306fc7149 (patch) | |
tree | 064f4fb2aa805fdca5152bdec87d3d34ad093139 | |
parent | 5ed4722de8106a512a4faacfedaae7b8eda7260b (diff) | |
download | mediagoblin-b1db2c2e744dc0e5fcd10b53792c6ce306fc7149.tar.lz mediagoblin-b1db2c2e744dc0e5fcd10b53792c6ce306fc7149.tar.xz mediagoblin-b1db2c2e744dc0e5fcd10b53792c6ce306fc7149.zip |
slug-style urls in previous and next urls look much better
Bug #434 - identifies media by slug instead of _id in prev/next
-rw-r--r-- | mediagoblin/db/models.py | 4 |
1 files 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']}) |