chore: remove duplicate code (#28646)

[skip ci]
This commit is contained in:
Ankush Menat 2021-11-30 17:57:53 +05:30 committed by GitHub
parent e10ab1626c
commit 0854c183aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -96,15 +96,8 @@ class Employee(NestedSet):
'user': self.user_id
})
if employee_user_permission_exists: return
employee_user_permission_exists = frappe.db.exists('User Permission', {
'allow': 'Employee',
'for_value': self.name,
'user': self.user_id
})
if employee_user_permission_exists: return
if employee_user_permission_exists:
return
add_user_permission("Employee", self.name, self.user_id)
set_user_permission_if_allowed("Company", self.company, self.user_id)