Skip to content

Commit

Permalink
fix: init company structure resource (#191)
Browse files Browse the repository at this point in the history
* fix: init company structure resource

* fix: notice_info null
  • Loading branch information
simontigers authored Oct 9, 2023
1 parent d442eb4 commit 5a20674
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmdb-api/api/commands/click_common_setting.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def init_backend_resource(self):
else:
resource_type = results[0]

for name in ['公司信息', '通知设置']:
for name in ['公司信息', '公司架构', '通知设置']:
payload = dict(
type_id=resource_type['id'],
app_id=acl.app_name,
Expand Down
6 changes: 4 additions & 2 deletions cmdb-api/api/lib/common_setting/employee.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,8 @@ def remove_bind_notice_by_uid(_platform, _uid):
existed = EmployeeCRUD.get_employee_by_uid(_uid)
employee_data = existed.to_dict()

notice_info = copy.deepcopy(employee_data.get('notice_info', {}))
notice_info = employee_data.get('notice_info', {})
notice_info = copy.deepcopy(notice_info) if notice_info else {}

notice_info[_platform] = ''

Expand Down Expand Up @@ -515,7 +516,8 @@ def bind_notice_by_uid(_platform, _uid):

employee_data = existed.to_dict()

notice_info = copy.deepcopy(employee_data.get('notice_info', {}))
notice_info = employee_data.get('notice_info', {})
notice_info = copy.deepcopy(notice_info) if notice_info else {}

notice_info[_platform] = '' if not target_id else target_id

Expand Down

0 comments on commit 5a20674

Please sign in to comment.