From ed7289ef710fd23095bed597d4b2fe119600a185 Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 4 Aug 2023 16:03:46 +0300 Subject: [PATCH] fix visual bug --- files/helpers/media.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/helpers/media.py b/files/helpers/media.py index 32fdb1a7e..806559eff 100644 --- a/files/helpers/media.py +++ b/files/helpers/media.py @@ -177,9 +177,9 @@ def process_image(filename, v, resize=0, trim=False, uploader_id=None, db=None): # to avoid this, we'll simply return None instead has_request = has_request_context() size = os.stat(filename).st_size - patron = bool(v and v.patron) + is_patron = bool(v and v.patron) - if size > MAX_IMAGE_AUDIO_SIZE_MB_PATRON * 1024 * 1024 or not patron and size > MAX_IMAGE_AUDIO_SIZE_MB * 1024 * 1024: + if size > MAX_IMAGE_AUDIO_SIZE_MB_PATRON * 1024 * 1024 or not is_patron and size > MAX_IMAGE_AUDIO_SIZE_MB * 1024 * 1024: os.remove(filename) if has_request: abort(413, f"Max image/audio size is {MAX_IMAGE_AUDIO_SIZE_MB} MB ({MAX_IMAGE_AUDIO_SIZE_MB_PATRON} MB for {patron}s)")