From 45e396428545d31bf606d12515ecf9bbd5232138 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Mon, 20 Dec 2021 11:06:51 +0530 Subject: [PATCH] fix: renamed signup hook and moved default form to a template --- school/hooks.py | 2 +- school/plugins.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/school/hooks.py b/school/hooks.py index 323d089e..c7334667 100644 --- a/school/hooks.py +++ b/school/hooks.py @@ -189,6 +189,6 @@ page_renderer = [ # set this to "/" to have profiles on the top-level profile_url_prefix = "/users/" -custom_signup_form = "school/templates/signup-form.html" if frappe.db.get_single_value("LMS Settings", "verify_age") else None +signup_form_template = "school.plugins.show_custom_signup" on_login = "school.overrides.user.set_country_from_ip" diff --git a/school/plugins.py b/school/plugins.py index 5643f57c..490a07ca 100644 --- a/school/plugins.py +++ b/school/plugins.py @@ -109,3 +109,8 @@ def youtube_video_renderer(video_id): def video_renderer(src): return "".format(src) + +def show_custom_signup(): + if frappe.db.get_single_value("LMS Settings", "verify_age"): + return "school/templates/signup-form.html" + return None