Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/src/pages/JobDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ const job = createResource({
onSuccess: (data) => {
if (user.data?.name) {
jobApplication.submit()
applicationCount.submit()
}
applicationCount.submit()
},
})

Expand Down
8 changes: 6 additions & 2 deletions lms/lms/doctype/course_evaluator/test_course_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,12 @@ def test_schedule_dates(self):

def calculated_first_date_of_schedule(self):
today = getdate()
offset = (0 - today.weekday() + 7) % 7 # 0 for Monday
first_date = add_days(today, offset)
offset_monday = (0 - today.weekday() + 7) % 7 # 0 for Monday
offset_wednesday = (2 - today.weekday() + 7) % 7 # 2 for Wednesday
if offset_monday < offset_wednesday:
first_date = add_days(today, offset_monday)
else:
first_date = add_days(today, offset_wednesday)
return first_date

def calculated_last_date_of_schedule(self, first_date):
Expand Down
2 changes: 1 addition & 1 deletion lms/lms/doctype/lms_enrollment/lms_enrollment.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def validate_course_enrollment_eligibility(self):
"reference_doctype": "LMS Course",
"reference_docname": self.course,
"member": self.member,
"payment_receipt": True,
"payment_received": True,
},
)

Expand Down
3 changes: 2 additions & 1 deletion lms/lms/doctype/lms_settings/lms_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
],
"fields": [
{
"default": "https://falcon.frappe.io/",
"fieldname": "livecode_url",
"fieldtype": "Data",
"label": "LiveCode URL"
Expand Down Expand Up @@ -451,7 +452,7 @@
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2025-12-10 17:36:15.689695",
"modified": "2025-12-22 11:30:13.868031",
"modified_by": "sayali@frappe.io",
"module": "LMS",
"name": "LMS Settings",
Expand Down
7 changes: 6 additions & 1 deletion lms/lms/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1800,14 +1800,19 @@ def validate_enrollment_eligibility(batch_doc, payment_doc=None):
if not payment_doc or not payment_doc.payment_received:
frappe.throw(_("Payment is required to enroll in this batch."))

elif not batch_doc.allow_self_enrollment:
elif not batch_doc.allow_self_enrollment and not is_admin():
frappe.throw(_("Enrollment in this batch is restricted. Please contact the Administrator."))

students = frappe.db.count("LMS Batch Enrollment", {"batch": batch_doc.name})
if batch_doc.seat_count and students >= batch_doc.seat_count:
frappe.throw(_("There are no seats available in this batch."))


def is_admin():
roles = frappe.get_roles(frappe.session.user)
return "Course Creator" in roles or "Moderator" in roles or "Batch Evaluator" in roles


def create_enrollment(batch, payment_doc=None):
new_student = frappe.new_doc("LMS Batch Enrollment")
new_student.update(
Expand Down