Browse Source

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

Co-authored-by: feng <1304903146@qq.com>
pull/11775/head
fit2bot 1 year ago committed by GitHub
parent
commit
3d27986c96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      apps/audits/const.py
  2. 3
      apps/authentication/api/connection_token.py

1
apps/audits/const.py

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

3
apps/authentication/api/connection_token.py

@ -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()

Loading…
Cancel
Save