fix: renamed reapplication field to duration
This commit is contained in:
@@ -34,13 +34,12 @@
|
||||
"related_courses",
|
||||
"certification_section",
|
||||
"enable_certification",
|
||||
"expiry",
|
||||
"section_break_22",
|
||||
"grant_certificate_after",
|
||||
"evaluator",
|
||||
"column_break_22",
|
||||
"expiry",
|
||||
"max_attempts",
|
||||
"reapplication",
|
||||
"duration",
|
||||
"pricing_section",
|
||||
"paid_certificate",
|
||||
"currency",
|
||||
@@ -221,18 +220,14 @@
|
||||
"depends_on": "eval: doc.grant_certificate_after == \"Evaluation\"",
|
||||
"fieldname": "max_attempts",
|
||||
"fieldtype": "Int",
|
||||
"label": "Max Number of Attempts for Evaluations"
|
||||
"label": "Max Attempts for Evaluations"
|
||||
},
|
||||
{
|
||||
"depends_on": "eval: doc.grant_certificate_after == \"Evaluation\"",
|
||||
"fieldname": "reapplication",
|
||||
"fieldname": "duration",
|
||||
"fieldtype": "Select",
|
||||
"label": "Re-application After (Months)",
|
||||
"label": "Duration for Attempts",
|
||||
"options": "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12"
|
||||
},
|
||||
{
|
||||
"fieldname": "section_break_22",
|
||||
"fieldtype": "Section Break"
|
||||
}
|
||||
],
|
||||
"is_published_field": "published",
|
||||
@@ -258,7 +253,7 @@
|
||||
"link_fieldname": "course"
|
||||
}
|
||||
],
|
||||
"modified": "2022-04-25 17:47:23.648958",
|
||||
"modified": "2022-04-28 16:15:10.047183",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "LMS Course",
|
||||
|
||||
@@ -25,7 +25,7 @@ class TestUtils(unittest.TestCase):
|
||||
"grant_certificate_after": "Evaluation",
|
||||
"evaluator": "evaluator@example.com",
|
||||
"max_attempts": 3,
|
||||
"reapplication": 2
|
||||
"duration": 2
|
||||
})
|
||||
user = new_user("Eval", "eval@test.com")
|
||||
|
||||
|
||||
@@ -346,7 +346,7 @@ def get_popular_courses():
|
||||
return course_membership[:3]
|
||||
|
||||
def get_evaluation_details(course, member=None):
|
||||
info = frappe.db.get_value("LMS Course", course, ["grant_certificate_after", "max_attempts", "reapplication"], as_dict=True)
|
||||
info = frappe.db.get_value("LMS Course", course, ["grant_certificate_after", "max_attempts", "duration"], as_dict=True)
|
||||
request = frappe.db.get_value("LMS Certificate Request", {
|
||||
"course": course,
|
||||
"member": member or frappe.session.user,
|
||||
@@ -358,7 +358,7 @@ def get_evaluation_details(course, member=None):
|
||||
"course": course,
|
||||
"member": member or frappe.session.user,
|
||||
"status": ["!=", "Pass"],
|
||||
"creation": [">=", add_months(getdate(), -abs(cint(info.reapplication)))]
|
||||
"creation": [">=", add_months(getdate(), -abs(cint(info.duration)))]
|
||||
})
|
||||
|
||||
return frappe._dict({
|
||||
|
||||
@@ -15,7 +15,7 @@ def get_context(context):
|
||||
course = frappe.db.get_value("LMS Course", course_name,
|
||||
["name", "title", "image", "short_introduction", "description", "published", "upcoming", "disable_self_learning",
|
||||
"status", "video_link", "enable_certification", "grant_certificate_after", "paid_certificate",
|
||||
"price_certificate", "currency", "max_attempts", "reapplication"],
|
||||
"price_certificate", "currency", "max_attempts", "duration"],
|
||||
as_dict=True)
|
||||
|
||||
if course is None:
|
||||
|
||||
Reference in New Issue
Block a user