aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2014-12-03 13:25:19 -0600
committerChristopher Allan Webber <cwebber@dustycloud.org>2014-12-03 15:40:58 -0600
commitddabf20f256fc2eab97c72f0e9072ab784e0a904 (patch)
treee756a25d0aacf5beb497436a16a9c3ade449b6a0
parent7c563e91bf66b0c01dfceb65c614b0da84ed91c3 (diff)
downloadmediagoblin-ddabf20f256fc2eab97c72f0e9072ab784e0a904.tar.lz
mediagoblin-ddabf20f256fc2eab97c72f0e9072ab784e0a904.tar.xz
mediagoblin-ddabf20f256fc2eab97c72f0e9072ab784e0a904.zip
Make all mixin methods ignore mg_globals and use self._app instead
This commit sponsored by Daniel Lang. Thank you!
-rw-r--r--mediagoblin/db/mixin.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/mediagoblin/db/mixin.py b/mediagoblin/db/mixin.py
index 9b5c0e8e..e650ceb5 100644
--- a/mediagoblin/db/mixin.py
+++ b/mediagoblin/db/mixin.py
@@ -34,7 +34,6 @@ from datetime import datetime
from pytz import UTC
from werkzeug.utils import cached_property
-from mediagoblin import mg_globals
from mediagoblin.media_types import FileTypeNotSupported
from mediagoblin.tools import common, licenses
from mediagoblin.tools.pluginapi import hook_handle
@@ -204,14 +203,14 @@ class MediaEntryMixin(GenerateSlugMixin):
# TODO: implement generic fallback in case MEDIA_MANAGER does
# not specify one?
if u'thumb' in self.media_files:
- thumb_url = mg_globals.app.public_store.file_url(
+ thumb_url = self._app.public_store.file_url(
self.media_files[u'thumb'])
else:
# No thumbnail in media available. Get the media's
# MEDIA_MANAGER for the fallback icon and return static URL
# Raises FileTypeNotSupported in case no such manager is enabled
manager = self.media_manager
- thumb_url = mg_globals.app.staticdirector(manager[u'default_thumb'])
+ thumb_url = self._app.staticdirector(manager[u'default_thumb'])
return thumb_url
@property
@@ -221,7 +220,7 @@ class MediaEntryMixin(GenerateSlugMixin):
if u"original" not in self.media_files:
return self.thumb_url
- return mg_globals.app.public_store.file_url(
+ return self._app.public_store.file_url(
self.media_files[u"original"]
)