[Fix] Candidate can apply to multiple jobs

This commit is contained in:
Kanchan Chauhan 2017-03-06 14:40:43 +05:30
parent a07c3193cf
commit 8411be7720

View File

@ -36,7 +36,7 @@ class JobApplicant(Document):
def check_email_id_is_unique(self):
if self.email_id:
names = frappe.db.sql_list("""select name from `tabJob Applicant`
where email_id=%s and name!=%s""", (self.email_id, self.name))
where email_id=%s and name!=%s and job_title=%s""", (self.email_id, self.name, self.job_title))
if names:
frappe.throw(_("Email Address must be unique, already exists for {0}").format(comma_and(names)), frappe.DuplicateEntryError)