summaryrefslogtreecommitdiff
path: root/app.py
diff options
context:
space:
mode:
authorcyfraeviolae <cyfraeviolae>2022-08-27 05:46:17 -0400
committercyfraeviolae <cyfraeviolae>2022-08-27 05:46:17 -0400
commit36b27e733c83e02ac54d7a6c1aa0a43938d1fc1f (patch)
tree23f97f54ec8390c782a4a6aa34135e95894570b0 /app.py
parent00e2704d0039ed9dbbfec54b2643da395f642f66 (diff)
key com
Diffstat (limited to 'app.py')
-rw-r--r--app.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/app.py b/app.py
index 800b263..01bdef6 100644
--- a/app.py
+++ b/app.py
@@ -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):