slug-style urls in previous and next urls look much better
Bug #434 - identifies media by slug instead of _id in prev/next
This commit is contained in:
parent
5ed4722de8
commit
b1db2c2e74
@ -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']})
|
||||
|
Loading…
x
Reference in New Issue
Block a user