diff options
author | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2013-03-10 20:56:48 +0100 |
---|---|---|
committer | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2013-03-10 21:19:16 +0100 |
commit | e9330b9552858d46783971e8624ccc5ac80cfe46 (patch) | |
tree | ec937a0d1c835ecffa89b52c2aa10ff1533d7f7c /extlib/jquery | |
parent | 8da84493328a029649e146b8e6fcc95011783b8b (diff) | |
download | mediagoblin-e9330b9552858d46783971e8624ccc5ac80cfe46.tar.lz mediagoblin-e9330b9552858d46783971e8624ccc5ac80cfe46.tar.xz mediagoblin-e9330b9552858d46783971e8624ccc5ac80cfe46.zip |
655: Fix collection fetching for media_collect()
The problem is:
Collection.query.filter_by(id=X, ...)
1. X = form.collection.data
This works nicely for the completely empty form (X = None).
It does not work for a selected collection, because X
will be the collection, not its id.
2. X = request.form.get('collection') (old code).
This one works mostly, except for the completely empty
form on postgres, because in this case X = u"__None" and
postgres does not like comparing an integer column with
a string.
Fix:
collection = form.collection.data
if collection and collection.creator != request.user.id:
collection = None
Diffstat (limited to 'extlib/jquery')
0 files changed, 0 insertions, 0 deletions