Fixed validation message for disabled employee
This commit is contained in:
parent
1dd6329e5b
commit
cb6430575b
File diff suppressed because it is too large
Load Diff
@ -133,11 +133,11 @@ class Employee(Document):
|
||||
def validate_for_enabled_user_id(self):
|
||||
if not self.status == 'Active':
|
||||
return
|
||||
enabled = frappe.db.sql("""select name from `tabUser` where
|
||||
name=%s and enabled=1""", self.user_id)
|
||||
if not enabled:
|
||||
throw(_("User {0} is disabled").format(
|
||||
self.user_id), EmployeeUserDisabledError)
|
||||
enabled = frappe.db.get_value("User", self.user_id, "enabled")
|
||||
if enabled is None:
|
||||
frappe.throw(_("User {0} does not exist").format(self.user_id))
|
||||
if enabled == 0:
|
||||
frappe.throw(_("User {0} is disabled").format(self.user_id), EmployeeUserDisabledError)
|
||||
|
||||
def validate_duplicate_user_id(self):
|
||||
employee = frappe.db.sql_list("""select name from `tabEmployee` where
|
||||
|
Loading…
Reference in New Issue
Block a user