From 94e130febdc0428c229f93370173b566451493bc Mon Sep 17 00:00:00 2001 From: TLSM Date: Tue, 18 Oct 2022 22:15:57 -0400 Subject: [PATCH] Fix video filesize check for patrons. --- files/helpers/media.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/files/helpers/media.py b/files/helpers/media.py index 9954af6f3..28ba9d15c 100644 --- a/files/helpers/media.py +++ b/files/helpers/media.py @@ -89,7 +89,9 @@ def process_video(file): file.save(old) size = os.stat(old).st_size - if SITE_NAME != 'WPD' and (size > MAX_VIDEO_SIZE_MB * 1024 * 1024 or not g.v.patron and size > MAX_VIDEO_SIZE_MB_PATRON * 1024 * 1024): + if (SITE_NAME != 'WPD' and + (size > MAX_VIDEO_SIZE_MB_PATRON * 1024 * 1024 + or not g.v.patron and size > MAX_VIDEO_SIZE_MB * 1024 * 1024)): os.remove(old) abort(413, f"Max video size is {MAX_VIDEO_SIZE_MB} MB ({MAX_VIDEO_SIZE_MB_PATRON} MB for paypigs)")