Changes between Initial Version and Version 2 of Ticket #26495
- Timestamp:
- Apr 12, 2016, 2:54:53 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #26495 – Description
initial v2 9 9 content = File(content) 10 10 }}} 11 Underlying libraries may use following pattern of code: 11 For example if custom storage uses requests with post query. 12 12 {{{ 13 13 #!python 14 def store(data, name): 15 data = data or '' 14 import requests 15 class CustomStorage(object): 16 def _save(self, name, content, max_length=None): 17 requests.post('http://testhost.org/upload', data=content) 16 18 }}} 17 But File object without a name resolved into False which can produce bugs.19 But it will result in empty upload as bool(content) is False. 18 20 Possibly better to pass a name to File object. To ensure bool(content) is True 19 21 {{{