diff options
author | Jessica Tallon <tsyesika@tsyesika.se> | 2015-08-24 18:28:41 +0200 |
---|---|---|
committer | Jessica Tallon <tsyesika@tsyesika.se> | 2015-08-24 21:07:06 +0200 |
commit | b4997540dcc7b75441e9b10ee6dcac32cc2708be (patch) | |
tree | e543baf0acc77214c44bad9f826d9187459539a9 /mediagoblin/moderation/views.py | |
parent | e9bb5879f772e4d546aadb4bb6f935c7c55b8000 (diff) | |
download | mediagoblin-b4997540dcc7b75441e9b10ee6dcac32cc2708be.tar.lz mediagoblin-b4997540dcc7b75441e9b10ee6dcac32cc2708be.tar.xz mediagoblin-b4997540dcc7b75441e9b10ee6dcac32cc2708be.zip |
Fix some unit tests and bugs
This fixes a lot of the issues with the LocalUser changes that were
merged recently. There was a problem where the attributes of LocalUser
were not being eagerly loaded and because the Session was detached an
exception was being raised when they were accessed.
This also fixes some typo's which were introduced.
Finally this adds a temporary fix for a potential SQLAlchemy bug, this
is a bug where doing:
User.query.filter(LocalUser.username == "some_username").first()
does NOT yeild a user with the username "some_username" but all users
on the site. The temp fix is to just query the LocalUser, this should
be resolved when bug is confirmed and fixed upstream.
Diffstat (limited to 'mediagoblin/moderation/views.py')
-rw-r--r-- | mediagoblin/moderation/views.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mediagoblin/moderation/views.py b/mediagoblin/moderation/views.py index b99f4660..a73537d6 100644 --- a/mediagoblin/moderation/views.py +++ b/mediagoblin/moderation/views.py @@ -79,7 +79,7 @@ def moderation_users_detail(request): ''' Shows details about a particular user. ''' - user = User.query.filter( + user = LocalUser.query.filter( LocalUser.username==request.matchdict['user'] ).first() active_reports = user.reports_filed_on.filter( |