From 242d5c5c5b92b1b6654999a47a892601216c5b21 Mon Sep 17 00:00:00 2001 From: YadominJinta Date: Wed, 20 Oct 2021 10:16:06 +0800 Subject: [PATCH] fix: move self.config to the end of __init__ --- app/filter.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/filter.py b/app/filter.py index 00d51d9..37cb957 100644 --- a/app/filter.py +++ b/app/filter.py @@ -45,8 +45,6 @@ class Filter: def __init__(self, user_key: str, mobile=False, config=None) -> None: if config is None: config = {} - else: - self.config = config self.near = config['near'] if 'near' in config else '' self.dark = config['dark'] if 'dark' in config else False self.nojs = config['nojs'] if 'nojs' in config else False @@ -56,6 +54,7 @@ class Filter: self.user_key = user_key self.main_divs = ResultSet('') self._elements = 0 + self.config = config def __getitem__(self, name): return getattr(self, name)