fix: registration button should be visible if batch starts today but a few hours are left
This commit is contained in:
@@ -8,7 +8,6 @@ import requests
|
|||||||
from frappe import _
|
from frappe import _
|
||||||
from frappe.desk.doctype.dashboard_chart.dashboard_chart import get_result
|
from frappe.desk.doctype.dashboard_chart.dashboard_chart import get_result
|
||||||
from frappe.desk.doctype.notification_log.notification_log import make_notification_logs
|
from frappe.desk.doctype.notification_log.notification_log import make_notification_logs
|
||||||
from frappe.desk.search import get_user_groups
|
|
||||||
from frappe.desk.notifications import extract_mentions
|
from frappe.desk.notifications import extract_mentions
|
||||||
from frappe.utils import (
|
from frappe.utils import (
|
||||||
add_months,
|
add_months,
|
||||||
@@ -20,7 +19,6 @@ from frappe.utils import (
|
|||||||
format_date,
|
format_date,
|
||||||
get_datetime,
|
get_datetime,
|
||||||
getdate,
|
getdate,
|
||||||
validate_phone_number,
|
|
||||||
get_fullname,
|
get_fullname,
|
||||||
pretty_date,
|
pretty_date,
|
||||||
get_time_str,
|
get_time_str,
|
||||||
@@ -1390,6 +1388,13 @@ def get_batch_details(batch):
|
|||||||
batch_details.instructors = get_instructors(batch)
|
batch_details.instructors = get_instructors(batch)
|
||||||
batch_details.accept_enrollments = batch_details.start_date > getdate()
|
batch_details.accept_enrollments = batch_details.start_date > getdate()
|
||||||
|
|
||||||
|
if (
|
||||||
|
not batch_details.accept_enrollments
|
||||||
|
and batch_details.start_date == getdate()
|
||||||
|
and get_time_str(batch_details.start_time) > nowtime()
|
||||||
|
):
|
||||||
|
batch_details.accept_enrollments = True
|
||||||
|
|
||||||
batch_details.courses = frappe.get_all(
|
batch_details.courses = frappe.get_all(
|
||||||
"Batch Course", filters={"parent": batch}, fields=["course", "title", "evaluator"]
|
"Batch Course", filters={"parent": batch}, fields=["course", "title", "evaluator"]
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user