perf: asset login 消息通知添加操作日志记录 (#11774)

Co-authored-by: feng <1304903146@qq.com>
pull/11775/head
fit2bot 2023-10-09 17:16:38 +08:00 committed by GitHub
parent c981e9cd9f
commit 3d27986c96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -33,6 +33,7 @@ class ActionChoices(TextChoices):
reject = 'reject', _('Reject')
accept = 'accept', _('Accept')
review = 'review', _('Review')
notice = 'notice', _('Notifications')
class LoginTypeChoices(TextChoices):

View File

@ -412,6 +412,9 @@ class ConnectionTokenViewSet(ExtraActionApiMixin, RootOrgViewMixin, JMSModelView
return ticket
if acl.is_action(acl.ActionChoices.notice):
reviewers = acl.reviewers.all()
if not reviewers:
return
self._record_operate_log(acl, asset)
for reviewer in reviewers:
AssetLoginReminderMsg(reviewer, asset, user).publish_async()