chore: remove unused code
diff --git a/erpnext/hr/doctype/leave_type/leave_type.py b/erpnext/hr/doctype/leave_type/leave_type.py
index 598bff2..c0d1296 100644
--- a/erpnext/hr/doctype/leave_type/leave_type.py
+++ b/erpnext/hr/doctype/leave_type/leave_type.py
@@ -17,8 +17,7 @@
 				'leave_type': self.name,
 				'from_date': ("<=", today()),
 				'to_date': (">=", today())
-			}, ['name'])
+			}, fields=['name'])
 			leave_allocation = [l['name'] for l in leave_allocation]
-			frappe.db("""select name from `tabLeave Allocation` where leave_type=%s""", (self.name))
 			if leave_allocation:
-				frappe.throw(_('Leave application is linked with leave allocations {0}. Leave application cannot be set as leave without pay').format(", ".join(leave_allocation))) #nosec
\ No newline at end of file
+				frappe.throw(_('Leave application is linked with leave allocations {0}. Leave application cannot be set as leave without pay').format(", ".join(leave_allocation))) #nosec