Fix slug lookup regression (#587)
authorSebastian Spaeth <Sebastian@SSpaeth.de>
Tue, 8 Jan 2013 07:59:32 +0000 (08:59 +0100)
committerSebastian Spaeth <Sebastian@SSpaeth.de>
Tue, 8 Jan 2013 07:59:32 +0000 (08:59 +0100)
commit7f4e42b0b15aefcc885c9aacefac3a76f2f7b5ad
treef5cf72fe2dca8c5472d774616eddd8142aa015ce
parent76e6c2b15ee6a42e754584142e76e7ce9854eec9
Fix slug lookup regression (#587)

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>
mediagoblin/decorators.py