Skip to content

Commit

Permalink
refactor: move import statements up
Browse files Browse the repository at this point in the history
  • Loading branch information
vinyselopal committed Mar 28, 2024
1 parent 4e39521 commit b64d6b5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions hrms/hr/doctype/attendance/attendance.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
# License: GNU General Public License v3. See license.txt


import json

import frappe
from frappe import _
from frappe.desk.reportview import get_filters_cond
from frappe.model.document import Document
from frappe.utils import (
add_days,
Expand All @@ -16,6 +19,8 @@
nowdate,
)

from erpnext.controllers.status_updater import validate_status

from hrms.hr.doctype.shift_assignment.shift_assignment import has_overlapping_timings
from hrms.hr.utils import (
get_holiday_dates_for_employee,
Expand All @@ -34,7 +39,6 @@ class OverlappingShiftAttendanceError(frappe.ValidationError):

class Attendance(Document):
def validate(self):
from erpnext.controllers.status_updater import validate_status

validate_status(self.status, ["Present", "Absent", "On Leave", "Half Day", "Work From Home"])
validate_active_employee(self.employee)
Expand Down Expand Up @@ -238,8 +242,6 @@ def get_events(start, end, filters=None):
if not employee:
return events

from frappe.desk.reportview import get_filters_cond

conditions = get_filters_cond("Attendance", filters, [])
add_attendance(events, start, end, conditions=conditions)
add_holidays(events, start, end, employee)
Expand Down Expand Up @@ -324,7 +326,6 @@ def mark_attendance(

@frappe.whitelist()
def mark_bulk_attendance(data):
import json

if isinstance(data, str):
data = json.loads(data)
Expand Down

0 comments on commit b64d6b5

Please sign in to comment.