2976 Commits

Author SHA1 Message Date
Sebastian Spaeth
0eff207dff tests/auth: Don't rely on case sensitive error strings
webob's 404 status is "404 NOT FOUND" while werkzeug's is
"404 Not Found". Our test suite was checking the upper case string
for equality. Just test the status error code "404" rather than the
full string which might change at some points/versions and should
not need to be tested.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-21 08:12:25 +01:00
Sebastian Spaeth
950124e640 webob.HTTPFound --> MG.tools.redirect
Transition away from webob.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-21 08:11:40 +01:00
Sebastian Spaeth
62d14bf50b Transition webob.HttpForbidden to webob's exceptions Forbidden
Also the BadRequest exception.
2012-12-21 08:11:40 +01:00
Sebastian Spaeth
059eaee4df Remove webobisms from decorators.py
Use our own redirect function rather than webobs HttpFound
Also replace HttpForbidden() with webob's Forbidden()
2012-12-21 08:11:40 +01:00
Sebastian Spaeth
53f528cfea purge webob from docs and replace with werkzeug 2012-12-21 08:10:48 +01:00
Sebastian Spaeth
b745bb50d8 Remove webob from render_to_response
We were still using webob's Response objects for template rendering.
Transition to werkzeug's Response object. One caveat was that it
seemed to have used the default mimetype "text/plain" for all pages,
so we override the default Response class, setting the default mime
type to "text/html".

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-21 08:10:48 +01:00
Sebastian Spaeth
4487d51c81 Extend redirect helper to take optional location keyword
In order to move away from webob with its redirect(location=...) we
need to provide a redirect function that allows to directly specify
the URL rather than the urlgen parameters that we now use.

Extend our MG.tools:redirect helper so we can pass in the direct URL
via the optional "location" keyword.

This commit does not switch over any redirect consumers yet.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-21 08:10:48 +01:00
Sebastian Spaeth
30bb4109bc Remove SimpleFieldAlias
It was only used for the model._id -> model.id conversion and is not
needed anymore.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-21 00:30:48 +01:00
Sebastian Spaeth
5c2b84869f Move DBModel._id -> DBModel.id
We were refering to model._id in most of the code base as this is
what Mongo uses. However, each use of _id required a) fixup of queries:
e.g. what we did in our find() and find_one() functions moving all
'_id' to 'id'. It also required using AliasFields to make the ._id
attribute available. This all means lots of superfluous fixing and
transitioning in a SQL world.

It will also not work in the long run. Much newer code already refers
to the objects by model.id (e.g. in the oauth plugin), which will break
with Mongo. So let's be honest, rip out the _id mongoism and live with
.id as the one canonical way to address objects.

This commit modifies all users and providers of model._id to use
model.id instead. This patch works with or without Mongo removed first,
but will break Mongo usage (even more than before)

I have not bothered to fixup db.mongo.* and db.sql.convert
(which converts from Mongo to SQL)

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-21 00:30:48 +01:00
Sebastian Spaeth
7e55bcb898 Fix up tests
empty find() queries would not work anymore with the simplified .find
compatability code, so remove these and use proper sqlalchemy in the
tests.

The storage test failed because my virtualenv environment ran
mediagoblin/local/mediagoblin/tests/test_storage.py and somehow decided
the 2 classes are different objects. Just test against the full class name.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-21 00:30:48 +01:00
Mike Linksvayer
42ce372e38 actual upgrade instructions 2012-12-20 12:52:31 -08:00
Mike Linksvayer
1d0148aef1 Merge branch 'master' of git://gitorious.org/mediagoblin/mediagoblin
Conflicts:
	docs/source/siteadmin/media-types.rst
2012-12-20 12:50:43 -08:00
Christopher Allan Webber
5c99cd01a7 Fixing tyop'ed "dbupdate" 2012-12-20 13:54:03 -06:00
Christopher Allan Webber
f822ab0de9 NOW RELEASING: MediaGoblin 0.3.2! :D 2012-12-20 11:16:29 -06:00
Christopher Allan Webber
6a9f537e6c Committing extracted and compiled translations 2012-12-20 10:11:54 -06:00
Christopher Allan Webber
7d7def6510 Committing present MediaGoblin translations before pushing extracted messages 2012-12-20 10:11:34 -06:00
Christopher Allan Webber
1f01df1dfc 0.3.2 release notes 2012-12-20 09:48:47 -06:00
Christopher Allan Webber
231a06f2d0 Updating AUTHORS with new contributors. Nice job new contributors! :) 2012-12-20 09:27:56 -06:00
Christopher Allan Webber
f4fe38d8e0 Committing extracted and compiled translations 2012-12-20 09:19:50 -06:00
Christopher Allan Webber
3fe3b2229c Docs fix: Adding proper blank line after the "Run::" 2012-12-20 08:23:03 -06:00
Christopher Allan Webber
5ef7ab084f Added documentation on how to add STL support, and notes on running ./bin/gmg dbupdate 2012-12-20 08:18:56 -06:00
Sebastian Spaeth
0efc4e4dbf Only log output and write progress to db if it has changed
De-noisify the transcoding log and db updates. Previously we would log
and save the progress percentage every second, even if it had not changed
at all. Save progress:oercentage in the Transcoder and only log/update
when the percentage has actually changed.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-19 15:48:30 +01:00
Sebastian Spaeth
4d9b426ccf Try ipython-based shell first, falling back to plain shell
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-19 10:33:29 +01:00
Sebastian Spaeth
6469040e4d Try ipython-based shell first, falling back to plain shell
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-19 10:32:01 +01:00
Christopher Allan Webber
b28005984c makeadmin and changepasswd had swapped help text 2012-12-18 16:46:20 -06:00
Jef van Schendel
98b927250e Remove collection_thumbnail styling, so collection thumbnails are styled the same as other thumbnails 2012-12-16 21:57:19 +01:00
Sebastian Spaeth
cacb6feae4 Release note 0.3.2 blurb
On MongoDB...
2012-12-15 21:00:41 +01:00
Christopher Allan Webber
9d5cd0b924 Adding info to the docs about running dbupdate
Both adding info to run it when adding new media types, and adding
info that you might need to stop mediagoblin before you run these
commands.
2012-12-14 18:29:00 -06:00
Christopher Allan Webber
00da119ec3 Switching both gettext calls to _() so babel can find/extract them.
Babel looks for _() and gettext() so this is necessary.
2012-12-14 10:49:05 -06:00
Christopher Allan Webber
cc81b5e55e Add comments explaining how translitcodec *is* used 2012-12-14 09:29:46 -06:00
Sebastian Spaeth
c843de8a57 Add example to the lazy gettext version to make clear when it's appropriate
I needed an example to really get when lazy_gettext would be good...
2012-12-14 15:16:49 +01:00
Sebastian Spaeth
18a52dacca Use the correct translation mechanism
We accidentally used the fake translation mechanism here which will not
actually translate anything.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-14 15:13:31 +01:00
Sebastian Spaeth
2f5926a65d Fiy python2.7'ism (#566)
The oauth plugin used timedelta.total_seconds which was introduced
in python 2.7 only. To preserve backwards compatability, we simply
calculate the time difference in seconds manually.

I considered monkeypatching total_seconds to the timedelta object,
but it is a built-in type written in C (I believe) and modifying
attributes failed horribly. Switch this to use total_seconds once we
require python 2.7 as minimum version.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-14 11:52:53 +01:00
Jef van Schendel
a04cd2e596 Small styling edits to thumbnails 2012-12-13 23:39:19 +01:00
Elrond
d2fad5c9c3 Make "add media to collection" a normal <img/>
This button used to be a css style <a href=...> </a> (note:
No contents for the <a>). Using this approach has various
drawbacks. Most notably:
- Not clickable in text mode browsers
- Possibly getting marked as a hidden (spam) link
- No alt attribute

So replaced with a real <img/>.

I have no idea what to put in the alt attribute.
2012-12-13 21:19:37 +01:00
Elrond
42fe4f9965 Migrate some fixes from base.html to airy/base.html.
When fixing our templates, we should always take a look at
the other themes and fix those too.
2012-12-13 15:39:22 +01:00
Elrond
248b7ba346 Do not translate just a variable expansion.
No point in translating <p>{{ var }}</p>. Really.

This does not hurt the string freeze, as it removes a
translateable string.  So any translations of this string
are just well ...  usefuless afterwards.
2012-12-12 21:51:19 +01:00
Elrond
13ab48a7c4 Fix spacing in links to attachment files.
We had """<a href="abc.dat"> abc.dat</a>""" (note the
apace).  And this space is being rendered as a link by
browsers.  This looks strange, really.

So fix the spacing.
2012-12-12 21:49:51 +01:00
Christopher Allan Webber
6af6bc05bb We don't need to save entries during processing... also adding comments explaining such 2012-12-12 10:14:24 -06:00
Sebastian Spaeth
af6a43d140 More unicode fixes in the test suite
Pass in unicode not (binary) strings where sqlite expects unicode
values to prevent the test suite from (correctly) complaining about
errors.

I now pass the full suite without any complaints.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-12 12:35:26 +01:00
Christopher Allan Webber
8ba4380ff7 Setting the user profile back to 3 columns wide!
Previously this was set to two when the spacing between thumbs got borkified.
2012-12-11 20:00:08 -06:00
Sebastian Spaeth
fc7b1b17eb Make sqlalchemy stop complaining about non-unicode input
These tests output noisy sql complaints about receiving non-unicode
for an unicode field. This was ... well ... because we were handing
in non-unicode usernames and passwords.

Prefixing usernames/passwords with u'' makes the testsuite less noisy
and verbose.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-11 16:55:11 +01:00
Sebastian Spaeth
d24a82970e Fix CSRF tests with webtest 1.4.0
CSRF tests apparently passed with earlier versions of webtest, but
failed with the latest webtest (1.4.0) package. It choked on passing
a "key=value; " cookie as it split at the semicolon and failed to
find additional values or something like that. Removing the semicolon
makes this test pass.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-11 15:38:28 +01:00
Christopher Allan Webber
78fd5581a9 Remove print statments from this migration.
The reason for wanting to give extra information to the user (this is
a very special case migration) is good, but we don't have a nice
"official" way to capture and present that information during tests,
so removing this.
2012-12-10 16:17:24 -06:00
Elrond
a64abbb10a Fix typo, disable debugging. 2012-12-10 16:17:24 -06:00
Elrond
ea91c183ff UniqueConstraing migration: Adding the explaining comments.
Add a lengthy comment explaining all the variants.
2012-12-10 16:17:24 -06:00
Elrond
0f14c362c3 Fixing our broken CollectionItem unique constraint.
This one seems to work nicely in all relevant situations.
See comments inside the source.
2012-12-10 16:17:24 -06:00
Nathan Yergler
afe0afdb88 Ensure query_dict is a dict after the contents have been modified.
_fix_query_dict modifies its argument in place. Ensure that the
argument passed in has a local name and will be passed into the
subsequent filter_by call.
2012-12-10 12:30:04 +01:00
Christopher Allan Webber
41fc4698c5 Eeek! Set the migration number to the current migration number being run! 2012-12-09 12:20:06 -06:00
Christopher Allan Webber
a4eef7fe91 Elrond's suggestion: have set_current_migration execute after each migration run. 2012-12-09 12:12:07 -06:00