mirror of
https://codeberg.org/prof_x_pvt_ltd/captive.whump.shanti-portal
synced 2024-08-14 22:46:42 +00:00
move up chain
This commit is contained in:
parent
88acc7752a
commit
9032edb0bd
1 changed files with 3 additions and 6 deletions
|
@ -18,6 +18,9 @@ class Client(object):
|
|||
self.storage = kw.pop('storage')
|
||||
self._chain = kw.pop('chain')
|
||||
|
||||
self._ip_address = kw.pop('ip_address', None)
|
||||
self.protocol = kw.pop('protocol', None)
|
||||
|
||||
# First try to get an existing client by ID
|
||||
self.client_id = kw.pop('client_id', None)
|
||||
if self.client_id:
|
||||
|
@ -28,10 +31,6 @@ class Client(object):
|
|||
if client_data is None:
|
||||
raise StorageNotFound('Client not found')
|
||||
else:
|
||||
# Next try to get an existing client by IP and protocol
|
||||
self.ip_address = kw.pop('ip_address')
|
||||
self.protocol = kw.pop('protocol')
|
||||
|
||||
client_data = self.storage.get_client(
|
||||
self._ip_address,
|
||||
self.protocol
|
||||
|
@ -45,8 +44,6 @@ class Client(object):
|
|||
self.load_client(client_data)
|
||||
else:
|
||||
self.client_id = str(uuid4())
|
||||
self.ip_address = kw.pop('ip_address')
|
||||
self.protocol = kw.pop('protocol')
|
||||
self.created = datetime.now()
|
||||
self.enabled = False
|
||||
self.last_packets = 0
|
||||
|
|
Loading…
Reference in a new issue