fix: add_employee_from_acl (#225)

This commit is contained in:
simontigers
2023-10-24 14:20:40 +08:00
committed by GitHub
parent b6c41c00dd
commit 7d53180a2f
2 changed files with 18 additions and 1 deletions

View File

@@ -121,6 +121,19 @@ class EmployeeCRUD(object):
employee = CreateEmployee().create_single(**data)
return employee.to_dict()
@staticmethod
def add_employee_from_acl_created(**kwargs):
try:
kwargs['acl_uid'] = kwargs.pop('uid')
kwargs['acl_rid'] = kwargs.pop('rid')
kwargs['department_id'] = 0
Employee.create(
**kwargs
)
except Exception as e:
abort(400, str(e))
@staticmethod
def add(**kwargs):
try: