chore(style): fix formatting

This commit is contained in:
Rucha Mahabal
2023-01-03 14:36:36 +05:30
parent a2bd8d22cb
commit 03af48b50b
2 changed files with 15 additions and 19 deletions

View File

@@ -5,8 +5,16 @@
import frappe import frappe
from frappe import _ from frappe import _
from frappe.model.document import Document from frappe.model.document import Document
from frappe.query_builder import Criterion from frappe.utils import (
from frappe.utils import cint, cstr, formatdate, get_datetime, get_link_to_form, getdate, nowdate, add_days add_days,
cint,
cstr,
formatdate,
get_datetime,
get_link_to_form,
getdate,
nowdate,
)
from erpnext.hr.utils import get_holiday_dates_for_employee, validate_active_employee from erpnext.hr.utils import get_holiday_dates_for_employee, validate_active_employee
@@ -107,8 +115,6 @@ class Attendance(Document):
frappe.throw(_("Employee {0} is not active or does not exist").format(self.employee)) frappe.throw(_("Employee {0} is not active or does not exist").format(self.employee))
def unlink_attendance_from_checkins(self): def unlink_attendance_from_checkins(self):
from frappe.utils import get_link_to_form
EmployeeCheckin = frappe.qb.DocType("Employee Checkin") EmployeeCheckin = frappe.qb.DocType("Employee Checkin")
linked_logs = ( linked_logs = (
frappe.qb.from_(EmployeeCheckin) frappe.qb.from_(EmployeeCheckin)

View File

@@ -14,11 +14,8 @@ from frappe.utils import (
nowdate, nowdate,
) )
from erpnext.setup.doctype.employee.test_employee import make_employee from erpnext.hr.doctype.attendance.attendance import get_unmarked_days, mark_attendance
from erpnext.hr.doctype.attendance.attendance import ( from erpnext.hr.doctype.employee.test_employee import make_employee
get_unmarked_days,
mark_attendance,
)
from erpnext.hr.tests.test_utils import get_first_sunday from erpnext.hr.tests.test_utils import get_first_sunday
test_records = frappe.get_test_records("Attendance") test_records = frappe.get_test_records("Attendance")
@@ -57,9 +54,7 @@ class TestAttendance(FrappeTestCase):
mark_attendance(employee, attendance_date, "Present") mark_attendance(employee, attendance_date, "Present")
unmarked_days = get_unmarked_days( unmarked_days = get_unmarked_days(
employee, employee, get_first_day(attendance_date), get_last_day(attendance_date)
get_first_day(attendance_date),
get_last_day(attendance_date)
) )
unmarked_days = [getdate(date) for date in unmarked_days] unmarked_days = [getdate(date) for date in unmarked_days]
@@ -86,10 +81,7 @@ class TestAttendance(FrappeTestCase):
mark_attendance(employee, attendance_date, "Present") mark_attendance(employee, attendance_date, "Present")
unmarked_days = unmarked_days = get_unmarked_days( unmarked_days = unmarked_days = get_unmarked_days(
employee, employee, get_first_day(attendance_date), get_last_day(attendance_date), exclude_holidays=True
get_first_day(attendance_date),
get_last_day(attendance_date),
exclude_holidays=True
) )
unmarked_days = [getdate(date) for date in unmarked_days] unmarked_days = [getdate(date) for date in unmarked_days]
@@ -119,9 +111,7 @@ class TestAttendance(FrappeTestCase):
mark_attendance(employee, attendance_date, "Present") mark_attendance(employee, attendance_date, "Present")
unmarked_days = get_unmarked_days( unmarked_days = get_unmarked_days(
employee, employee, get_first_day(attendance_date), get_last_day(attendance_date)
get_first_day(attendance_date),
get_last_day(attendance_date)
) )
unmarked_days = [getdate(date) for date in unmarked_days] unmarked_days = [getdate(date) for date in unmarked_days]