mirror of https://github.com/jumpserver/jumpserver
[Update] 修复资产用户管理器获取 __name__ 的问题
parent
a5e59e6787
commit
214b4026ec
|
@ -71,9 +71,9 @@ class AssetUserManager:
|
||||||
if len(instances) == 1:
|
if len(instances) == 1:
|
||||||
return instances[0]
|
return instances[0]
|
||||||
elif len(instances) == 0:
|
elif len(instances) == 0:
|
||||||
self.raise_does_not_exist(self.__name__)
|
self.raise_does_not_exist(self.__class__.__name__)
|
||||||
else:
|
else:
|
||||||
self.raise_multiple_return(self.__name__, len(instances))
|
self.raise_multiple_return(self.__class__.__name__, len(instances))
|
||||||
|
|
||||||
def raise_does_not_exist(self, name):
|
def raise_does_not_exist(self, name):
|
||||||
raise self.ObjectDoesNotExist(self.MSG_NOT_EXIST.format(name))
|
raise self.ObjectDoesNotExist(self.MSG_NOT_EXIST.format(name))
|
||||||
|
|
Loading…
Reference in New Issue