perf: change secret adjustment

pull/9019/head
feng 2022-11-04 11:09:56 +08:00
parent ebfc3b7b38
commit e995e3b35a
2 changed files with 2 additions and 4 deletions

View File

@ -192,10 +192,8 @@ class ChangeSecretManager(BasePlaybookManager):
self.send_recorder_mail(recorders) self.send_recorder_mail(recorders)
def send_recorder_mail(self, recorders): def send_recorder_mail(self, recorders):
if not recorders:
return
recipients = self.execution.recipients recipients = self.execution.recipients
if not recipients: if not recorders or not recipients:
return return
recipients = User.objects.filter(id__in=list(recipients)) recipients = User.objects.filter(id__in=list(recipients))

View File

@ -116,7 +116,7 @@ class BaseAccount(OrgModelMixin):
@property @property
def private_key_path(self): def private_key_path(self):
if not self.secret_type != 'ssh_key' or not self.secret: if not self.secret_type != SecretType.ssh_key or not self.secret:
return None return None
project_dir = settings.PROJECT_DIR project_dir = settings.PROJECT_DIR
tmp_dir = os.path.join(project_dir, 'tmp') tmp_dir = os.path.join(project_dir, 'tmp')