1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-22 13:34:04 +03:00

Fixed notify action

This commit is contained in:
Adolfo Gómez García 2023-05-10 23:26:33 +02:00
parent 3898cf7253
commit 159414f8e4
No known key found for this signature in database
GPG Key ID: DD1ABF20724CDA23

View File

@ -761,7 +761,7 @@ class Unmanaged(ActorV3Action):
# Try to infer the ip from the valid id (that could be an IP or a MAC)
ip: str
try:
ip = next(x['ip'] for x in self._params['id'] if x['ip'] == validId or x['mac'] == validId)
ip = next(x['ip'] for x in self._params['id'] if validId in (x['ip'], x['mac']))
except StopIteration:
ip = self._params['id'][0]['ip'] # Get first IP if no valid ip found
@ -813,7 +813,7 @@ class Notify(ActorV3Action):
try:
# Check block manually
checkBlockedIp(self._request) # pylint: disable=protected-access
if 'action' == 'login':
if self._params['action'] == 'login':
Login.action(typing.cast(Login, self))
else:
Logout.action(typing.cast(Logout, self))