cubicweb/wsgi/request.py
changeset 11154 221febada1e8
parent 11057 0b59724cb3f2
child 11767 432f87a63057
equal deleted inserted replaced
11153:e48db902af71 11154:221febada1e8
    79 
    79 
    80         super(CubicWebWsgiRequest, self).__init__(vreg, https, post,
    80         super(CubicWebWsgiRequest, self).__init__(vreg, https, post,
    81                                                   headers= headers_in)
    81                                                   headers= headers_in)
    82         self.content = environ['wsgi.input']
    82         self.content = environ['wsgi.input']
    83         if files is not None:
    83         if files is not None:
    84             for key, part in files.items():
    84             for key, part in files.iterallitems():
    85                 self.form[key] = (part.filename, part.file)
    85                 self.form.setdefault(key, []).append((part.filename, part.file))
       
    86             # 3.16.4 backward compat
       
    87             for key in files.keys():
       
    88                 if len(self.form[key]) == 1:
       
    89                     self.form[key] = self.form[key][0]
    86 
    90 
    87     def __repr__(self):
    91     def __repr__(self):
    88         # Since this is called as part of error handling, we need to be very
    92         # Since this is called as part of error handling, we need to be very
    89         # robust against potentially malformed input.
    93         # robust against potentially malformed input.
    90         form = pformat(self.form)
    94         form = pformat(self.form)