diff --git a/mediagoblin/db/mongo/models.py b/mediagoblin/db/mongo/models.py index 8cd0da1b..5de59c12 100644 --- a/mediagoblin/db/mongo/models.py +++ b/mediagoblin/db/mongo/models.py @@ -261,7 +261,7 @@ class MediaEntry(Document): Use a slug if we have one, else use our '_id'. """ - uploader = self.get_uploader() + uploader = self.get_uploader if self.get('slug'): return urlgen( @@ -297,6 +297,7 @@ class MediaEntry(Document): for media in cursor: return media.url_for_self(urlgen) + @property def get_uploader(self): return self.db.User.find_one({'_id': self.uploader}) diff --git a/mediagoblin/listings/views.py b/mediagoblin/listings/views.py index 6b83ffcf..3ecf06f4 100644 --- a/mediagoblin/listings/views.py +++ b/mediagoblin/listings/views.py @@ -86,7 +86,7 @@ def tag_atom_feed(request): feed.add(entry.get('title'), entry.get('description_html'), content_type='html', - author=entry.get_uploader().username, + author=entry.get_uploader.username, updated=entry.get('created'), url=entry.url_for_self(request.urlgen)) diff --git a/mediagoblin/templates/mediagoblin/edit/attachments.html b/mediagoblin/templates/mediagoblin/edit/attachments.html index 6a5ab896..124d0313 100644 --- a/mediagoblin/templates/mediagoblin/edit/attachments.html +++ b/mediagoblin/templates/mediagoblin/edit/attachments.html @@ -20,7 +20,7 @@ {% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} {% block mediagoblin_content %}