feat: billing banner for FC trial sites

This commit is contained in:
Jannat Patel
2025-02-17 15:07:31 +05:30
parent eeaec3369f
commit 6b634c15d9
7 changed files with 209 additions and 39 deletions

View File

@@ -22,7 +22,7 @@ from frappe.utils import (
from lms.lms.utils import get_average_rating, get_lesson_count
from xml.dom.minidom import parseString
from lms.lms.doctype.course_lesson.course_lesson import save_progress
from frappe.core.doctype.communication.email import make
from frappe.integrations.frappe_providers.frappecloud_billing import is_fc_site
@frappe.whitelist()
@@ -175,6 +175,7 @@ def get_user_info():
user.is_moderator = "Moderator" in user.roles
user.is_evaluator = "Batch Evaluator" in user.roles
user.is_student = "LMS Student" in user.roles
user.is_fc_site = is_fc_site()
return user

View File

@@ -1,8 +1,9 @@
import frappe
from frappe.utils.telemetry import capture
from frappe import _
from bs4 import BeautifulSoup
import re
from bs4 import BeautifulSoup
from frappe import _
from frappe.utils.telemetry import capture
from frappe.utils import cint
no_cache = 1
@@ -17,6 +18,7 @@ def get_context():
csrf_token = frappe.sessions.get_csrf_token()
frappe.db.commit() # nosemgrep
context.csrf_token = csrf_token
context.setup_complete = cint(frappe.get_system_settings("setup_complete"))
capture("active_site", "lms")
context.favicon = frappe.db.get_single_value("Website Settings", "favicon")
return context