From e1d0269a81f18f50868a67ce105209ae87233a39 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Wed, 22 Jun 2022 21:12:12 +0200 Subject: [PATCH] fix 413 error for patrons --- files/helpers/media.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/files/helpers/media.py b/files/helpers/media.py index abf828156..2bfd45feb 100644 --- a/files/helpers/media.py +++ b/files/helpers/media.py @@ -91,12 +91,10 @@ def process_video(file): def process_image(filename=None, resize=0): size = os.stat(filename).st_size - if resize == 100: patron = False - else: patron = g.v.patron - - if size > 16 * 1024 * 1024 or not patron and size > 8 * 1024 * 1024: - os.remove(filename) - abort(413) + if resize != 100: + if size > 16 * 1024 * 1024 or not patron and size > 8 * 1024 * 1024: + os.remove(filename) + abort(413) i = Image.open(filename)