mirror of https://github.com/veops/cmdb.git
fix(api): common i18n wide (#351)
* fix(api): common_i18n wide * fix(api): department i18n
This commit is contained in:
parent
7186bdac9c
commit
9ee2776bdd
|
@ -385,6 +385,9 @@ class DepartmentCRUD(object):
|
||||||
|
|
||||||
d['employee_count'] = len(list(filter(lambda e: e['department_id'] in d_ids, all_employee_list)))
|
d['employee_count'] = len(list(filter(lambda e: e['department_id'] in d_ids, all_employee_list)))
|
||||||
|
|
||||||
|
if int(department_parent_id) == -1:
|
||||||
|
d['department_name'] = ErrFormat.company_wide
|
||||||
|
|
||||||
return all_departments, department_id_list
|
return all_departments, department_id_list
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
|
@ -296,6 +296,8 @@ class EmployeeCRUD(object):
|
||||||
for r in pagination.items:
|
for r in pagination.items:
|
||||||
d = r.Employee.to_dict()
|
d = r.Employee.to_dict()
|
||||||
d['department_name'] = r.Department.department_name if r.Department else ''
|
d['department_name'] = r.Department.department_name if r.Department else ''
|
||||||
|
if r.Employee.department_id == 0:
|
||||||
|
d['department_name'] = ErrFormat.company_wide
|
||||||
employees.append(d)
|
employees.append(d)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in New Issue