'uploader': self.uploader,
'state': 'processed'}).sort(
'_id', ASCENDING).limit(1)
- if cursor.count():
- return urlgen('mediagoblin.user_pages.media_home',
- user=self.get_uploader().username,
- media=unicode(cursor[0].slug))
+ for media in cursor:
+ return media.url_for_self(urlgen)
def url_to_next(self, urlgen):
"""
'state': 'processed'}).sort(
'_id', DESCENDING).limit(1)
- if cursor.count():
- return urlgen('mediagoblin.user_pages.media_home',
- user=self.get_uploader().username,
- media=unicode(cursor[0].slug))
+ for media in cursor:
+ return media.url_for_self(urlgen)
def get_uploader(self):
return self.db.User.find_one({'_id': self.uploader})
</div>
</div>
{% endfor %}
- {{ render_pagination(request, pagination,
- request.urlgen('mediagoblin.user_pages.media_home',
- user = media.get_uploader().username,
- media = media._id)) }}
+ {{ render_pagination(request, pagination,
+ media.url_for_self(request.urlgen)) }}
{% endif %}
</div>
<div class="grid_5 omega">