Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: init company structure resource #191

Merged
merged 2 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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