forked from shaba/openuds
Fixed logout notification
This commit is contained in:
parent
73a3c89e04
commit
653bff420f
@ -60,7 +60,7 @@ class LoginResultInfoType(typing.NamedTuple):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def logged_in(self) -> bool:
|
def logged_in(self) -> bool:
|
||||||
return self.dead_line is not None or self.max_idle is not None or self.hostname != '' or self.ip != ''
|
return self.hostname != '' or self.ip != ''
|
||||||
|
|
||||||
class CertificateInfoType(typing.NamedTuple):
|
class CertificateInfoType(typing.NamedTuple):
|
||||||
private_key: str
|
private_key: str
|
||||||
|
@ -71,10 +71,10 @@ class UserService(UUIDModel): # pylint: disable=too-many-public-methods
|
|||||||
|
|
||||||
# The reference to deployed service is used to accelerate the queries for different methods, in fact its redundant cause we can access to the deployed service
|
# The reference to deployed service is used to accelerate the queries for different methods, in fact its redundant cause we can access to the deployed service
|
||||||
# through publication, but queries are much more simple
|
# through publication, but queries are much more simple
|
||||||
deployed_service: 'models.ForeignKey[UserService, ServicePool]' = models.ForeignKey(
|
deployed_service: models.ForeignKey['UserService', 'ServicePool'] = models.ForeignKey(
|
||||||
ServicePool, on_delete=models.CASCADE, related_name='userServices'
|
ServicePool, on_delete=models.CASCADE, related_name='userServices'
|
||||||
)
|
)
|
||||||
publication: 'models.ForeignKey[UserService, ServicePoolPublication]' = (
|
publication: models.ForeignKey['UserService', 'ServicePoolPublication'] = (
|
||||||
models.ForeignKey(
|
models.ForeignKey(
|
||||||
ServicePoolPublication,
|
ServicePoolPublication,
|
||||||
on_delete=models.CASCADE,
|
on_delete=models.CASCADE,
|
||||||
@ -98,7 +98,7 @@ class UserService(UUIDModel): # pylint: disable=too-many-public-methods
|
|||||||
state_date = models.DateTimeField(db_index=True)
|
state_date = models.DateTimeField(db_index=True)
|
||||||
creation_date = models.DateTimeField(db_index=True)
|
creation_date = models.DateTimeField(db_index=True)
|
||||||
data = models.TextField(default='')
|
data = models.TextField(default='')
|
||||||
user: 'models.ForeignKey[UserService, User]' = models.ForeignKey(
|
user: models.ForeignKey['UserService', 'User'] = models.ForeignKey(
|
||||||
User,
|
User,
|
||||||
on_delete=models.CASCADE,
|
on_delete=models.CASCADE,
|
||||||
related_name='userServices',
|
related_name='userServices',
|
||||||
@ -120,7 +120,7 @@ class UserService(UUIDModel): # pylint: disable=too-many-public-methods
|
|||||||
)
|
)
|
||||||
|
|
||||||
# "fake" declarations for type checking
|
# "fake" declarations for type checking
|
||||||
objects: 'models.BaseManager[UserService]'
|
objects: models.BaseManager['UserService']
|
||||||
properties: 'models.QuerySet[UserServiceProperty]'
|
properties: 'models.QuerySet[UserServiceProperty]'
|
||||||
accounting: 'AccountUsage'
|
accounting: 'AccountUsage'
|
||||||
|
|
||||||
@ -311,7 +311,7 @@ class UserService(UUIDModel): # pylint: disable=too-many-public-methods
|
|||||||
|
|
||||||
:note: If the transport did not notified this data, this may be "empty"
|
:note: If the transport did not notified this data, this may be "empty"
|
||||||
"""
|
"""
|
||||||
return (self.src_ip, self.src_hostname)
|
return (self.src_ip or '0.0.0.0', self.src_hostname or 'unknown')
|
||||||
|
|
||||||
def getOsManager(self) -> typing.Optional['OSManager']:
|
def getOsManager(self) -> typing.Optional['OSManager']:
|
||||||
return self.deployed_service.osmanager
|
return self.deployed_service.osmanager
|
||||||
|
Loading…
x
Reference in New Issue
Block a user