| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
As pointed out, we didn't need that nested if.
This commit sponsored by Paul Kuriakose. Thank you!
|
|
|
|
|
|
| |
Thanks for pointing this out, Elrond ;)
This commit sponsored by Gerardo Joven Valdivia. Thank you!
|
|
|
|
|
|
|
|
| |
/u/cwebber/m/4112/
This avoids some potential name collision issues.
This commit sponsored by Asokan Pichai. Thank you!
|
|
|
|
| |
This commit sponsored by Mats Sjöberg. Thanks!
|
| |
|
|
|
|
|
|
|
| |
User fields are always existent, so there is no need to .get() them,
just use them directly.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
|
|
|
|
|
|
|
|
|
|
|
| |
1) destroy_self() is a horrible function name, make it "destroy".
workbench.destroy() is descriptive enough.
2) WorkbenchManager.create_workbench() -> WorkbenchManager.create()
We use the pattern "with workbench_manager.create() as workbench:"
No need to mention workbenches three times in a row...
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
|
|
|
|
|
|
|
|
| |
This passes in a Workbench() via the 'workbench' keyword argument, and
conveniently cleans it up after the function has finished. 2 out of our 5
backends forgot to clean up their workbench, so this is clearly needed :-).
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have a bunch of URLs that are more for internal use. At
least they're definitely not intended to be posted
somewhere for long term useage.
When those things affect a media, it's much better to
reference the media by its id. This can't change, ever.
This is better for races.
Like someone posting a comment while the owner
corrects a typo in the slug.
|
|
|
|
|
|
|
|
|
|
|
| |
Removing the Mongo InvalidID legacy code removed an explicit check for
"int" for the id lookup. This led the @get_user_media_entry decorator to
fail if we looked up a nonexisting non-numerical slug (it tried to query
the id with a string, which failed). Cast id to int and return 404 in
case it is non-numeric which fixes the regression. It does not fix the
underlying problem of slug_or_id lookups that were discussed.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
|
| |
|
|
|
|
|
|
|
| |
This was one of the last remaining Mongo holdouts and has been removed from
the tree herewith. Good bye, ObjectId.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
|
|
|
|
|
|
| |
It was a NoOp in our Non-mongo world. So it is safe to remove.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
|
|
|
|
|
|
| |
controllers (view function) raise HttpException's and do not return them.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
|
|
|
|
|
| |
Use our own redirect function rather than webobs HttpFound
Also replace HttpForbidden() with webob's Forbidden()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
This can be used for URL patterns containing a <user> element. It will look
up the corresponding user among all active users and return a 404 NOT FOUND
page if there is no such active user. It then passes the User() instance as
url_user keyword argument to the decorated view function.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
|
| |
|
|
|
|
| |
It now includes the full URI, including GET args, not just the path.
|
| |
|
|
|
|
| |
This commit makes test_submission mostly warning-clean.
|
| |
|
|
|
|
|
|
| |
media.get_uploader()._id loads a complete user object
without actually needing it, because media.uploader already
has the id!
|
| |
|
| |
|
|
|
|
| |
See http://bugs.foocorp.net/issues/695
|
|\
| |
| |
| |
| |
| |
| |
| |
| | |
'remotes/lorochka85/bug852_use_media_slug_instead_of_id'
Conflicts:
mediagoblin/decorators.py
mediagoblin/templates/mediagoblin/user_pages/media.html
mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html
|
| |\ |
|
| | | |
|
| |/
|/|
| |
| |
| |
| |
| |
| | |
The .uploader() method conflicts with the uploader database
field. As we're moving to .FIELD for db field access, this
is a relevant conflict.
So renaming .uploader() to .get_uploader()
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Note: Migrations can't use "Dot Notation"!
Migrations run on pymongo, not mongokit.
So they can't use the "Dot Notation".
This isn't really a big issue, as migrations are anyway
quite mongo specific.
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
mediagoblin/db/migrations.py
mediagoblin/db/models.py
mediagoblin/user_pages/views.py
mediagoblin/util.py
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* Removed trailing whitespace
* Line length < 80 where possible
* Honor conventions on number of blank lines
* Honor conventions about spaces around :, =
|
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When running mediagoblin in a sub path on a web server,
most things inside mediagoblin need the "inside path", but
when generating URLs for the webbrowser, full paths are
needed.
urlgen and routes already do that.
Some (mostly pagination and login) need the URL of the
current page. They used request.path_info. But this is the
"inside" path, not the full.
So now there is request.full_path and its used in various
places.
|
|/ |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* Moved `mediagoblin.confirm` stuff to `mediagoblin.user_pages`,
templates too.
* Removed route extension for `mediagoblin.confirm`
* Created `delete_media_files` which deletes all media files
on the public_store when the entry is deleted
* Created a new decorator to check if a user has the permission
to delete an entry.
|
| |
|
| |
|
|
|
|
|
|
| |
Instead of import InvalidId from the low level bson module,
first import it in our db.util wrapper and second import it
from pymongo.errors.
|
|
|
|
|
| |
This is just replacing exc.HTTPFound(location=request.urlgen(...))
by redirect(request, ...). No magic.
|
|\
| |
| |
| |
| | |
Conflicts:
mediagoblin/templates/mediagoblin/user_pages/media.html
|
| | |
|
| |
| |
| |
| | |
their emails.
|
| |
| |
| |
| | |
to authenticate.
|
|/
|
|
|
| |
This adds a link to the "edit" form, the form, the view for
displaying the form and that's about it.
|
|
|
|
| |
of uploader embedding
|
|
|
|
| |
the decorator. (Thanks Elrond)
|