9 Commits

Author SHA1 Message Date
Jessica Tallon
b4997540dc 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.
2015-08-24 21:07:06 +02:00
Jessica Tallon
d88fcb03e2 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.
2015-07-31 15:15:24 +02:00
Berker Peksag
9d85dcdf11 Fix unicode handling in "gmg addmedia". 2014-11-22 18:12:19 +00:00
Berker Peksag
d9aced73f1 The file() builtin has been removed in Python 3. Use open() instead. 2014-06-07 13:51:42 +03:00
Berker Peksag
e49b7e02b2 Use six.text_type instead of unicode().
I will be switch to use ``from __future__ import unicode_literals`` later.
2014-06-02 20:59:28 +03:00
Christopher Allan Webber
210a6cebe0 Switching the addmedia tool over to using the get_upload_file_limits tool also.
This commit sponsored by Damien Radtke.  Thanks!
2013-11-14 11:09:18 -06:00
Christopher Allan Webber
86d5cb8a57 --license doesn't use the user default so correct that. It does use a URL though.
This commit sponsored by Benjamin Williams.  Thank you!
2013-11-14 10:25:31 -06:00
Christopher Allan Webber
862e05a5b5 Hacks to get past unicode barriers
The methods we're using here aren't ideal but they mirror those used
in the submit views...

This commit sponsored by Alexander Couper.  Thanks!
2013-11-14 09:51:29 -06:00
Christopher Allan Webber
b7a8760b6d Start of addmedia command. Kinda close to working ;) 2013-11-13 13:59:16 -06:00