I am running a Pylons project and have encountered this strange problem. When submitting the form, I have the opportunity to add a logo (simple .png). The logo is passed in the FieldStorage instance. I am trying to evaluate if a logo was sent with this:
if request.params.get('logo'): do x
However, this is always False, even if there is a logo. If I print request.params, I get UnicodeMultiDict([('logo', FieldStorage('logo', u'tux.png'))]) .
I solved this with:
if not request.params.get('logo') == None: do x
I do not understand why this works, but in the first example this is not.
source share