mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-07-15 23:46:30 +00:00
fix: account username has domain, then set again
This commit is contained in:
parent
558188da90
commit
b00d32b0f3
@ -166,9 +166,12 @@ class Account(AbsConnectivity, LabeledMixin, BaseAccount, JSONFilterMixin):
|
||||
return self.ds.domain_name
|
||||
return ''
|
||||
|
||||
def username_has_domain(self):
|
||||
return '@' in self.username or '\\' in self.username
|
||||
|
||||
@property
|
||||
def full_username(self):
|
||||
if self.ds_domain:
|
||||
if not self.username_has_domain() and self.ds_domain:
|
||||
return '{}@{}'.format(self.username, self.ds_domain)
|
||||
return self.username
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user