I am running a Pylons project and ran into this strange problem. When submitting a form i have an option to add a logo (simple .png). The logo is passed in a FieldStorage instance. I try to evaluate if the logo was sent with this:
if request.params.get('logo'):
do x
However, that always evaluates to False, even when there is logo. If I print request.params I get UnicodeMultiDict([('logo', FieldStorage('logo', u'tux.png'))])
.
I solved it with:
if not request.params.get('logo') == None:
do x
I fail to see why that works and the first example does not.