Changes between Initial Version and Version 2 of Ticket #26495


Ignore:
Timestamp:
Apr 12, 2016, 2:54:53 PM (9 years ago)
Author:
Maxim Novikov
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #26495 – Description

    initial v2  
    99            content = File(content)
    1010}}}
    11 Underlying libraries may use following pattern of code:
     11For example if custom storage uses requests with post query.
    1212{{{
    1313#!python
    14 def store(data, name):
    15      data = data or ''
     14import requests
     15class CustomStorage(object):
     16    def _save(self, name, content, max_length=None):
     17          requests.post('http://testhost.org/upload', data=content)
    1618}}}
    17 But File object without a name resolved into False which can produce bugs.
     19But it will result in empty upload as bool(content) is False.
    1820Possibly better to pass a name to File object. To ensure bool(content) is True
    1921{{{
Back to Top