From 71d0a89968af1a74f350482fd7cc924bcfb2615d Mon Sep 17 00:00:00 2001 From: pateljannat Date: Fri, 9 Jul 2021 15:05:46 +0530 Subject: [PATCH] fix: made image non mandatory, remove unnecessary code --- community/hooks.py | 3 +-- community/lms/doctype/lms_course/lms_course.json | 5 ++--- community/www/batch/utils.py | 1 - community/www/courses/course.py | 3 --- 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/community/hooks.py b/community/hooks.py index f6a8b4ab..61b681f5 100644 --- a/community/hooks.py +++ b/community/hooks.py @@ -167,8 +167,7 @@ whitelist = [ "/add-a-new-batch", "/new-sign-up", "/message", - "/about", - "/review" + "/about" ] whitelist_rules = [{"from_route": p, "to_route": p[1:]} for p in whitelist] diff --git a/community/lms/doctype/lms_course/lms_course.json b/community/lms/doctype/lms_course/lms_course.json index d35fa59f..a654c9e0 100644 --- a/community/lms/doctype/lms_course/lms_course.json +++ b/community/lms/doctype/lms_course/lms_course.json @@ -86,8 +86,7 @@ { "fieldname": "image", "fieldtype": "Attach Image", - "label": "Preview Image", - "reqd": 1 + "label": "Preview Image" }, { "fieldname": "tags", @@ -119,7 +118,7 @@ "link_fieldname": "course" } ], - "modified": "2021-06-28 12:04:21.524161", + "modified": "2021-07-09 15:05:05.372430", "modified_by": "Administrator", "module": "LMS", "name": "LMS Course", diff --git a/community/www/batch/utils.py b/community/www/batch/utils.py index 5445bc10..e8c99c74 100644 --- a/community/www/batch/utils.py +++ b/community/www/batch/utils.py @@ -17,7 +17,6 @@ def get_common_context(context): context.course = course membership = course.get_membership(frappe.session.user, batch_name) - print(membership) context.membership = membership if membership: batch = course.get_batch(membership.batch) diff --git a/community/www/courses/course.py b/community/www/courses/course.py index c847cdba..0248fead 100644 --- a/community/www/courses/course.py +++ b/community/www/courses/course.py @@ -19,6 +19,3 @@ def get_context(context): membership = course.get_membership(frappe.session.user) context.course.query_parameter = "?batch=" + membership.batch if membership and membership.batch else "" context.membership = membership - if not course.is_mentor(frappe.session.user) and membership: - """ frappe.local.flags.redirect_location = f"/courses/{course.name}/learn" - raise frappe.Redirect """