Commit e19aace4 authored by Diaoul's avatar Diaoul

Support callable base_path in FileUploadField

parent b59dcbdf
...@@ -226,6 +226,8 @@ class FileUploadField(fields.StringField): ...@@ -226,6 +226,8 @@ class FileUploadField(fields.StringField):
if not self.base_path: if not self.base_path:
raise ValueError('FileUploadField field requires base_path to be set.') raise ValueError('FileUploadField field requires base_path to be set.')
if callable(self.base_path):
return op.join(self.base_path(), filename)
return op.join(self.base_path, filename) return op.join(self.base_path, filename)
def _delete_file(self, filename): def _delete_file(self, filename):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment