perf: 修改工单创建授权规则的字段(created_by)

pull/5378/head
Bai 2021-01-04 14:32:33 +08:00 committed by Jiangjie.Bai
parent 7e7e24f51f
commit aab59403e1
3 changed files with 4 additions and 3 deletions

View File

@ -100,7 +100,8 @@ class CreatePermissionMixin:
# create permission
def create_permission(self):
create_method = getattr(self, f'create_{self.type}_permission', lambda: None)
create_method()
permission = create_method()
return permission
class CreateCommentMixin:

View File

@ -120,7 +120,7 @@ class CreatePermissionMixin:
'category': apply_category,
'type': apply_type,
'comment': permission_comment,
'created_by': self.processor_display,
'created_by': '{}:{}'.format(str(self.__class__.__name__), str(self.id)),
'date_start': approve_date_start,
'date_expired': approve_date_expired,
}

View File

@ -121,7 +121,7 @@ class CreatePermissionMixin:
'id': self.id,
'name': permission_name,
'comment': permission_comment,
'created_by': self.processor_display,
'created_by': '{}:{}'.format(str(self.__class__.__name__), str(self.id)),
'actions': approve_actions,
'date_start': approve_date_start,
'date_expired': approve_date_expired,