diff --git a/apiserver/paasng/locale/en/LC_MESSAGES/django.po b/apiserver/paasng/locale/en/LC_MESSAGES/django.po index a19674e627..73681346b5 100644 --- a/apiserver/paasng/locale/en/LC_MESSAGES/django.po +++ b/apiserver/paasng/locale/en/LC_MESSAGES/django.po @@ -809,10 +809,8 @@ msgstr "Delete" #: paasng/bk_plugins/pluginscenter/constants.py:147 #: paasng/misc/audit/constants.py:88 -#, fuzzy -#| msgid "已下架" msgid "下架" -msgstr "Archived" +msgstr "archive" #: paasng/bk_plugins/pluginscenter/constants.py:148 msgid "重新上架" @@ -1718,16 +1716,16 @@ msgstr "renew" msgid "部署" msgstr "Deploy" -#: paasng/misc/audit/models.py:103 -#, python-brace-format -msgid " {self.module_name} 模块{env}" -msgstr " {self.module_name} module {env}" - #: paasng/misc/audit/models.py:105 #, python-brace-format msgid " {self.module_name} 模块" msgstr " {self.module_name} module" +#: paasng/misc/audit/models.py:103 +#, python-brace-format +msgid " {self.module_name} 模块{env}" +msgstr " {self.module_name} module {env}" + #: paasng/misc/audit/models.py:107 #, python-brace-format msgid "{env}" @@ -1736,7 +1734,7 @@ msgstr "{env}" #: paasng/misc/audit/models.py:122 #, python-brace-format msgid "{user} {operation}{module_env_info}{result}" -msgstr "{user} {operation}{module_env_info}{result}" +msgstr "{user} {operation}{module_env_info} {result}" #: paasng/misc/audit/models.py:127 #, python-brace-format diff --git a/apiserver/paasng/paasng/misc/audit/handlers.py b/apiserver/paasng/paasng/misc/audit/handlers.py index 7487beacc5..a02897e490 100644 --- a/apiserver/paasng/paasng/misc/audit/handlers.py +++ b/apiserver/paasng/paasng/misc/audit/handlers.py @@ -30,6 +30,7 @@ from paasng.misc.audit import constants from paasng.misc.audit.models import AppLatestOperationRecord, AppOperationRecord from paasng.misc.audit.service import DataDetail, add_app_audit_record +from paasng.platform.applications.constants import ApplicationType from paasng.platform.applications.models import Application, ModuleEnvironment from paasng.platform.engine.constants import JobStatus from paasng.platform.engine.models import Deployment @@ -102,6 +103,8 @@ def on_model_post_save(sender, instance, created, raw, using, update_fields, *ar def on_deploy_finished(sender: ModuleEnvironment, deployment: Deployment, **kwargs): """当普通应用部署完成后,记录操作审计记录""" application = deployment.app_environment.application + if application.type != ApplicationType.DEFAULT: + return result_code = JOB_STATUS_TO_RESULT_CODE.get(deployment.status, constants.ResultCode.ONGOING) add_app_audit_record( app_code=application.code, diff --git a/apiserver/paasng/paasng/platform/engine/deploy/archive/base.py b/apiserver/paasng/paasng/platform/engine/deploy/archive/base.py index 9aff06897a..fcd775e39a 100644 --- a/apiserver/paasng/paasng/platform/engine/deploy/archive/base.py +++ b/apiserver/paasng/paasng/platform/engine/deploy/archive/base.py @@ -127,7 +127,7 @@ def finish_archive(self, operation_id: str, status: ReleaseStatus, error_detail: action_id=AppAction.BASIC_DEVELOP, operation=OperationEnum.OFFLINE, target=OperationTarget.APP, - module_name=offline_op.app_environmenv.module.name, + module_name=offline_op.app_environment.module.name, environment=offline_op.app_environment.environment, result_code=result_code, )