diff options
author | Jessica Tallon <tsyesika@tsyesika.se> | 2015-07-17 17:51:51 +0200 |
---|---|---|
committer | Jessica Tallon <tsyesika@tsyesika.se> | 2015-07-31 15:15:24 +0200 |
commit | d88fcb03e2e520da6a7d0203d660e4536108f56b (patch) | |
tree | 75b751fae15a037301bb384e64eba13746cb57a6 /mediagoblin/plugins/archivalook/tools.py | |
parent | 283e6d8b9f09341e3b97418b79f389bfdfee6498 (diff) | |
download | mediagoblin-d88fcb03e2e520da6a7d0203d660e4536108f56b.tar.lz mediagoblin-d88fcb03e2e520da6a7d0203d660e4536108f56b.tar.xz mediagoblin-d88fcb03e2e520da6a7d0203d660e4536108f56b.zip |
Change codebase to query or create correct User model
The code base had many references to User.username and other
specific to LocalUser attributes as that was the way it use to exist.
This updates those to query on the generic User model but filtering
by attributes on the LocalUser.
Diffstat (limited to 'mediagoblin/plugins/archivalook/tools.py')
-rw-r--r-- | mediagoblin/plugins/archivalook/tools.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mediagoblin/plugins/archivalook/tools.py b/mediagoblin/plugins/archivalook/tools.py index b495624c..12142212 100644 --- a/mediagoblin/plugins/archivalook/tools.py +++ b/mediagoblin/plugins/archivalook/tools.py @@ -16,7 +16,7 @@ import six -from mediagoblin.db.models import MediaEntry, User +from mediagoblin.db.models import MediaEntry, User, LocalUser from mediagoblin.plugins.archivalook.models import FeaturedMedia from mediagoblin.tools.translate import lazy_pass_to_ugettext as _ from mediagoblin.plugins.archivalook.models import FeaturedMedia @@ -36,10 +36,11 @@ def get_media_entry_from_uploader_slug(uploader_username, slug): matches the specifications. """ uploader = User.query.filter( - User.username == uploader_username).first() + LocalUser.username==uploader_username + ).first() media = MediaEntry.query.filter( - MediaEntry.get_uploader == uploader ).filter( - MediaEntry.slug == slug).first() + MediaEntry.get_uploader == uploader ).filter( + MediaEntry.slug == slug).first() return media @@ -292,4 +293,3 @@ def demote_feature(media_entry): elif target_feature.display_type == u'primary': target_feature.display_type = u'secondary' target_feature.save() - |