ajenti / ajenti

Consider decorating method with @staticmethod PYL-R0201
Performance
Major
3 months ago4 years old
Method doesn't use the class instance and could be converted into a static method
109                return output
110        return http_context.fallthrough(self.invalid)
111
112    def respond_error(self, http_context, exception):113        http_context.respond_server_error()
114        stack = traceback.format_exc()
115        traceback.print_exc()
Method doesn't use the class instance and could be converted into a static method
245    def __init__(self, context):
246        self.context = context
247
248    def provide(self):249        return []
250
251
Method doesn't use the class instance and could be converted into a static method
235            self.context.worker.demote(uid, gid)
236        self.context.identity = username
237
238    def prepare_session_redirect(self, http_context, username, auth_info):239        http_context.add_header('X-Session-Redirect', username)
240        http_context.add_header('X-Auth-Info', auth_info)
241
Method doesn't use the class instance and could be converted into a static method
205            raise SudoError((o + e).decode('utf-8').splitlines()[-1].strip())
206        return True
207
208    def client_certificate_callback(self, connection, x509, errno, depth, result):209        if depth == 0 and (errno == 9 or errno == 10):
210            return False  # expired / not yet valid
211        if not aj.config.data['ssl']['client_auth']['force']:
Method doesn't use the class instance and could be converted into a static method
191    def check_password(self, username, password):
192        return self.get_provider().authenticate(username, password)
193
194    def check_sudo_password(self, username, password):195        if not aj.config.data['auth'].get('allow_sudo', False):
196            return False
197        sudo = subprocess.Popen(