From 74c085b0a7337821d1b32baf83d7b460a2d3919a Mon Sep 17 00:00:00 2001 From: msinkec Date: Tue, 25 May 2021 15:13:25 +0200 Subject: [PATCH] fixed predavanja bug --- portal/base.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/portal/base.py b/portal/base.py index ab086cb..11f8098 100644 --- a/portal/base.py +++ b/portal/base.py @@ -194,13 +194,11 @@ class UploadHandler: except Exception: traceback.print_exc() - - @staticmethod - def check_suffixes(files): + def check_suffixes(self, files): for key, f in files.items(): if key.startswith('file'): suffix = f.filename.split('.')[-1] - if ENABLED_FILETYPES and suffix not in ENABLED_FILETYPES: + if self.ENABLED_FILETYPES and suffix not in self.ENABLED_FILETYPES: return 'Datoteka "{}" ni pravilnega formata.'.format(f.filename) return None @@ -220,7 +218,7 @@ class UploadHandler: elif len(files) < 1: return 'Priložena ni bila nobena datoteka.', 400 - err = UploadHandler.check_suffixes(files) + err = self.check_suffixes(files) if err: return err, 400