chore: Cleanup imports (#27320)

* chore: Added isort to pre-commit config

* chore: Sort imports with isort

* chore: Remove imports with pycln

* chore: Sort imports with isort

* chore: Fix import issues

* chore: Fix sider issues

* chore: linting

* chore: linting / sorting import

from ecommerce refactor merge

* ci: dont allow unused imports

* chore: sort / clean ecommerce imports

Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
This commit is contained in:
Chillar Anand
2021-09-03 18:57:43 +05:30
committed by GitHub
parent 910b9bc3f4
commit 4b2be2999f
2103 changed files with 7844 additions and 3106 deletions

View File

@@ -1,7 +1,9 @@
from __future__ import unicode_literals
import frappe
from frappe import _
class StudentNotInGroupError(frappe.ValidationError): pass
def validate_student_belongs_to_group(student, student_group):

View File

@@ -3,12 +3,15 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import json
import frappe
from frappe import _
from frappe.model.mapper import get_mapped_doc
from frappe.utils import flt, cstr, getdate
from frappe.email.doctype.email_group.email_group import add_subscribers
from frappe.model.mapper import get_mapped_doc
from frappe.utils import cstr, flt, getdate
def get_course(program):
'''Return list of courses for a particular program

View File

@@ -3,10 +3,12 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import getdate
from frappe.model.document import Document
from frappe.utils import getdate
class AcademicTerm(Document):
def autoname(self):

View File

@@ -1,6 +1,8 @@
from __future__ import unicode_literals
from frappe import _
def get_data():
return {
'fieldname': 'academic_term',

View File

@@ -3,7 +3,6 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Academic Term')

View File

@@ -3,10 +3,12 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import msgprint, _
from frappe import _
from frappe.model.document import Document
class AcademicYear(Document):
def validate(self):
#Check that start of academic year is earlier than end of academic year

View File

@@ -1,6 +1,8 @@
from __future__ import unicode_literals
from frappe import _
def get_data():
return {
'fieldname': 'academic_year',

View File

@@ -3,7 +3,6 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Academic Year')

View File

@@ -3,9 +3,11 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class Article(Document):
def get_article(self):
pass

View File

@@ -3,8 +3,8 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestArticle(unittest.TestCase):
pass

View File

@@ -3,6 +3,7 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document

View File

@@ -3,7 +3,6 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Assessment Criteria')

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class AssessmentCriteriaGroup(Document):
pass

View File

@@ -3,7 +3,6 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Assessment Criteria Group')

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class AssessmentGroup(Document):
pass

View File

@@ -1,8 +1,10 @@
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
from frappe import _
def get_data():
return {
'fieldname': 'assessment_group',

View File

@@ -3,7 +3,6 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Assessment Group')

View File

@@ -3,9 +3,11 @@
# For license information, please see license.txt
from __future__ import unicode_literals
from frappe.model.document import Document
import frappe
from frappe import _
from frappe.model.document import Document
class AssessmentPlan(Document):
def validate(self):

View File

@@ -1,8 +1,10 @@
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
from frappe import _
def get_data():
return {
'fieldname': 'assessment_plan',

View File

@@ -3,7 +3,6 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Assessment Plan')

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class AssessmentPlanCriteria(Document):
pass

View File

@@ -3,14 +3,16 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt
from frappe.model.document import Document
from erpnext.education.api import get_grade
from erpnext.education.api import get_assessment_details
from frappe.utils import flt
from frappe.utils.csvutils import getlink
import erpnext.education
from erpnext.education.api import get_assessment_details, get_grade
class AssessmentResult(Document):
def validate(self):

View File

@@ -1,8 +1,10 @@
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
from frappe import _
def get_data():
return {
'reports': [

View File

@@ -3,8 +3,8 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from erpnext.education.api import get_grade
# test_records = frappe.get_test_records('Assessment Result')

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class AssessmentResultDetail(Document):
pass

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class AssessmentResultTool(Document):
pass

View File

@@ -3,8 +3,8 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestAssessmentResultTool(unittest.TestCase):
pass

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class ContentActivity(Document):
pass

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class ContentQuestion(Document):
pass

View File

@@ -3,8 +3,8 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestContentQuestion(unittest.TestCase):
pass

View File

@@ -3,10 +3,13 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import json
from frappe.model.document import Document
import frappe
from frappe import _
from frappe.model.document import Document
class Course(Document):
def validate(self):

View File

@@ -1,8 +1,10 @@
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
from frappe import _
def get_data():
return {
'fieldname': 'course',

View File

@@ -2,11 +2,12 @@
# Copyright (c) 2015, Frappe Technologies and Contributors
# See license.txt
from __future__ import unicode_literals
from erpnext.education.doctype.topic.test_topic import make_topic
from erpnext.education.doctype.topic.test_topic import make_topic_and_linked_content
import unittest
import frappe
import unittest
from erpnext.education.doctype.topic.test_topic import make_topic, make_topic_and_linked_content
# test_records = frappe.get_test_records('Course')

View File

@@ -3,10 +3,12 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
class CourseActivity(Document):
def validate(self):
self.check_if_enrolled()

View File

@@ -3,9 +3,11 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
import frappe
class TestCourseActivity(unittest.TestCase):
pass

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class CourseAssessmentCriteria(Document):
pass

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class CourseContent(Document):
pass

View File

@@ -3,8 +3,8 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestCourseContent(unittest.TestCase):
pass

View File

@@ -3,11 +3,14 @@
# For license information, please see license.txt
from __future__ import unicode_literals
from functools import reduce
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import get_link_to_form
from functools import reduce
class CourseEnrollment(Document):
def validate(self):

View File

@@ -1,8 +1,10 @@
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
from frappe import _
def get_data():
return {
'fieldname': 'enrollment',

View File

@@ -3,14 +3,14 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
import frappe
from erpnext.education.doctype.student.test_student import create_student
from erpnext.education.doctype.student.test_student import get_student
from erpnext.education.doctype.program.test_program import setup_program
from erpnext.education.doctype.course_activity.test_course_activity import make_course_activity
from erpnext.education.doctype.program.test_program import setup_program
from erpnext.education.doctype.student.test_student import create_student, get_student
class TestCourseEnrollment(unittest.TestCase):
def setUp(self):

View File

@@ -3,10 +3,12 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
class CourseSchedule(Document):
def validate(self):
self.instructor_name = frappe.db.get_value("Instructor", self.instructor, "instructor_name")

View File

@@ -1,8 +1,10 @@
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
from frappe import _
def get_data():
return {
'fieldname': 'course_schedule',

View File

@@ -3,13 +3,13 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import datetime
import unittest
import datetime
from frappe.utils import today, to_timedelta
import frappe
from frappe.utils import to_timedelta, today
from erpnext.education.utils import OverlapError
from frappe.utils.make_random import get_random
# test_records = frappe.get_test_records('Course Schedule')

View File

@@ -3,11 +3,14 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import calendar
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import add_days, getdate
from erpnext.education.utils import OverlapError

View File

@@ -3,8 +3,8 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestCourseSchedulingTool(unittest.TestCase):
pass

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class CourseTopic(Document):
pass

View File

@@ -3,8 +3,8 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestCourseTopic(unittest.TestCase):
pass

View File

@@ -3,6 +3,7 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import frappe.defaults
from frappe.model.document import Document

View File

@@ -3,8 +3,8 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestEducationSettings(unittest.TestCase):
pass

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class FeeCategory(Document):
pass

View File

@@ -3,7 +3,6 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Fee Category')

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class FeeComponent(Document):
pass

View File

@@ -3,13 +3,15 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, erpnext
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.model.mapper import get_mapped_doc
from frappe.utils import money_in_words
from frappe.utils import cint, flt, cstr
from frappe.utils import cint, cstr, flt, money_in_words
from frappe.utils.background_jobs import enqueue
from frappe import _
import erpnext
class FeeSchedule(Document):

View File

@@ -2,6 +2,7 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
def get_data():
return {
'fieldname': 'fee_schedule',

View File

@@ -5,5 +5,6 @@ from __future__ import unicode_literals
import unittest
class TestFeeSchedule(unittest.TestCase):
pass

View File

@@ -3,7 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
from frappe.model.document import Document
class FeeScheduleProgram(Document):
pass

View File

@@ -3,7 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
from frappe.model.document import Document
class FeeScheduleStudentGroup(Document):
pass

View File

@@ -3,6 +3,7 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe.model.mapper import get_mapped_doc

View File

@@ -1,8 +1,10 @@
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
from frappe import _
def get_data():
return {
'fieldname': 'fee_structure',

View File

@@ -3,7 +3,6 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Fee Structure')

View File

@@ -3,14 +3,16 @@
# For license information, please see license.txt
from __future__ import unicode_literals
from frappe.model.document import Document
import frappe, erpnext
import frappe
from frappe import _
from frappe.utils import money_in_words
from erpnext.accounts.doctype.payment_request.payment_request import make_payment_request
from frappe.utils.csvutils import getlink
from erpnext.controllers.accounts_controller import AccountsController
import erpnext
from erpnext.accounts.doctype.payment_request.payment_request import make_payment_request
from erpnext.accounts.general_ledger import make_reverse_gl_entries
from erpnext.controllers.accounts_controller import AccountsController
class Fees(AccountsController):

View File

@@ -3,10 +3,12 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
import frappe
from frappe.utils import nowdate
from frappe.utils.make_random import get_random
from erpnext.education.doctype.program.test_program import make_program_and_linked_courses
test_dependencies = ['Company']

View File

@@ -3,10 +3,12 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import cint
from frappe.model.document import Document
from frappe.utils import cint
class GradingScale(Document):
def validate(self):

View File

@@ -1,6 +1,8 @@
from __future__ import unicode_literals
from frappe import _
def get_data():
return {
'fieldname': 'grading_scale',

View File

@@ -3,7 +3,6 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Grading Scale')

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class GradingScaleInterval(Document):
pass

View File

@@ -3,11 +3,13 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils.csvutils import getlink
class Guardian(Document):
def __setup__(self):
self.onload()

View File

@@ -3,7 +3,6 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Guardian')

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class GuardianInterest(Document):
pass

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class GuardianStudent(Document):
pass

View File

@@ -3,11 +3,13 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.model.naming import set_name_by_naming_series
class Instructor(Document):
def autoname(self):
naming_method = frappe.db.get_value("Education Settings", None, "instructor_created_by")

View File

@@ -1,8 +1,10 @@
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
from frappe import _
def get_data():
return {
'heatmap': True,

View File

@@ -3,7 +3,6 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Instructor')

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class InstructorLog(Document):
pass

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class Options(Document):
pass

View File

@@ -3,9 +3,11 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class Program(Document):
def get_course_list(self):

View File

@@ -1,5 +1,6 @@
from frappe import _
def get_data():
return {
'fieldname': 'program',

View File

@@ -2,12 +2,13 @@
# Copyright (c) 2015, Frappe Technologies and Contributors
# See license.txt
from __future__ import unicode_literals
from erpnext.education.doctype.course.test_course import make_course
from erpnext.education.doctype.topic.test_topic import make_topic_and_linked_content
from erpnext.education.doctype.course.test_course import make_course_and_linked_topic
import unittest
import frappe
import unittest
from erpnext.education.doctype.course.test_course import make_course, make_course_and_linked_topic
from erpnext.education.doctype.topic.test_topic import make_topic_and_linked_content
test_data = {
"program_name": "_Test Program",

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class ProgramCourse(Document):
pass

View File

@@ -3,12 +3,13 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import msgprint, _
from frappe import _, msgprint
from frappe.desk.reportview import get_match_cond
from frappe.model.document import Document
from frappe.desk.reportview import get_match_cond, get_filters_cond
from frappe.utils import comma_and, get_link_to_form, getdate
import erpnext.www.lms as lms
class ProgramEnrollment(Document):
def validate(self):

View File

@@ -1,6 +1,8 @@
from __future__ import unicode_literals
from frappe import _
def get_data():
return {
'fieldname': 'program_enrollment',

View File

@@ -3,13 +3,13 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from erpnext.education.doctype.student.test_student import create_student
from erpnext.education.doctype.student.test_student import get_student
import frappe
from erpnext.education.doctype.program.test_program import make_program_and_linked_courses
from erpnext.education.doctype.course_activity.test_course_activity import make_course_activity
from erpnext.education.doctype.student.test_student import create_student, get_student
class TestProgramEnrollment(unittest.TestCase):

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class ProgramEnrollmentCourse(Document):
pass

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class ProgramEnrollmentFee(Document):
pass

View File

@@ -3,12 +3,15 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from erpnext.education.api import enroll_student
from frappe.utils import cint
from erpnext.education.api import enroll_student
class ProgramEnrollmentTool(Document):
def onload(self):
academic_term_reqd = cint(frappe.db.get_single_value('Education Settings', 'academic_term_reqd'))

View File

@@ -3,8 +3,8 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestProgramEnrollmentTool(unittest.TestCase):
pass

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class ProgramEnrollmentToolStudent(Document):
pass

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class ProgramFee(Document):
pass

View File

@@ -3,10 +3,12 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
class Question(Document):
def validate(self):

View File

@@ -3,8 +3,8 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestQuestion(unittest.TestCase):
pass

View File

@@ -3,11 +3,12 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import json
from frappe import _
from frappe.model.document import Document
class Quiz(Document):
def validate(self):
if self.passing_score > 100:

View File

@@ -3,8 +3,8 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestQuiz(unittest.TestCase):
pass

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class QuizActivity(Document):
pass

View File

@@ -3,8 +3,8 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestQuizActivity(unittest.TestCase):
pass

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class QuizQuestion(Document):
pass

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class QuizResult(Document):
pass

View File

@@ -3,8 +3,8 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestQuizResult(unittest.TestCase):
pass

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class Room(Document):
pass

View File

@@ -1,8 +1,10 @@
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
from frappe import _
def get_data():
return {
'fieldname': 'room',

Some files were not shown because too many files have changed in this diff Show More