Flake8 add global __request__ to config
This commit is contained in:
parent
c115738535
commit
2f68092740
|
@ -276,7 +276,7 @@ class Auth(JSONComponent):
|
|||
:returns: True if the session is valid, False if not.
|
||||
:rtype: booleon
|
||||
"""
|
||||
return __request__.session_id is not None # NOQA
|
||||
return __request__.session_id is not None
|
||||
|
||||
@export
|
||||
def delete_session(self):
|
||||
|
@ -287,7 +287,7 @@ class Auth(JSONComponent):
|
|||
:type session_id: string
|
||||
"""
|
||||
config = component.get("DelugeWeb").config
|
||||
del config["sessions"][__request__.session_id] # NOQA
|
||||
del config["sessions"][__request__.session_id]
|
||||
return True
|
||||
|
||||
@export(AUTH_LEVEL_NONE)
|
||||
|
@ -301,7 +301,7 @@ class Auth(JSONComponent):
|
|||
:rtype: string or False
|
||||
"""
|
||||
if self.check_password(password):
|
||||
return self._create_session(__request__) # NOQA
|
||||
return self._create_session(__request__)
|
||||
else:
|
||||
log.error('Login failed (ClientIP %s)', __request__.getClientIP()) # NOQA
|
||||
log.error('Login failed (ClientIP %s)', __request__.getClientIP())
|
||||
return False
|
||||
|
|
|
@ -975,7 +975,7 @@ class WebApi(JSONComponent):
|
|||
:param event: The event name
|
||||
:type event: string
|
||||
"""
|
||||
self.event_queue.add_listener(__request__.session_id, event) # NOQA
|
||||
self.event_queue.add_listener(__request__.session_id, event)
|
||||
|
||||
@export
|
||||
def deregister_event_listener(self, event):
|
||||
|
@ -985,11 +985,11 @@ class WebApi(JSONComponent):
|
|||
:param event: The event name
|
||||
:type event: string
|
||||
"""
|
||||
self.event_queue.remove_listener(__request__.session_id, event) # NOQA
|
||||
self.event_queue.remove_listener(__request__.session_id, event)
|
||||
|
||||
@export
|
||||
def get_events(self):
|
||||
"""
|
||||
Retrieve the pending events for the session.
|
||||
"""
|
||||
return self.event_queue.get_events(__request__.session_id) # NOQA
|
||||
return self.event_queue.get_events(__request__.session_id)
|
||||
|
|
Loading…
Reference in New Issue