diff options
Diffstat (limited to 'app.py')
-rw-r--r-- | app.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -133,7 +133,8 @@ def FileSizeLimit(max_bytes, magic_start=None, magic_end=None): if not field.data: return s = field.data.read() - n = len(field.data.read()) + n = len(s) + print(max_bytes, n) if n > max_bytes: raise ValidationError(f"File size must be less than {max_bytes}B") if magic_start and not s.startswith(magic_start): |