mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-05 09:21:02 +00:00
fix: (smart endpoint 获取500的问题) (修复监控会话打开失败的问题)
This commit is contained in:
@@ -178,14 +178,11 @@ class Session(OrgModelMixin):
|
||||
def login_from_display(self):
|
||||
return self.get_login_from_display()
|
||||
|
||||
def get_asset_or_application(self):
|
||||
instance = get_object_or_none(Asset, pk=self.asset_id)
|
||||
if not instance:
|
||||
instance = get_object_or_none(Application, pk=self.asset_id)
|
||||
return instance
|
||||
def get_asset(self):
|
||||
return get_object_or_none(Asset, pk=self.asset_id)
|
||||
|
||||
def get_target_ip(self):
|
||||
instance = self.get_asset_or_application()
|
||||
instance = self.get_asset()
|
||||
target_ip = instance.get_target_ip() if instance else ''
|
||||
return target_ip
|
||||
|
||||
|
Reference in New Issue
Block a user