feat: brand settings

This commit is contained in:
Jannat Patel
2024-09-26 12:09:58 +05:30
parent 04552bdef6
commit e18f0c9dad
11 changed files with 304 additions and 114 deletions

View File

@@ -289,11 +289,13 @@ def get_file_info(file_url):
@frappe.whitelist(allow_guest=True)
def get_branding():
"""Get branding details."""
return {
"brand_name": frappe.db.get_single_value("Website Settings", "app_name"),
"brand_html": frappe.db.get_single_value("Website Settings", "brand_html"),
"favicon": frappe.db.get_single_value("Website Settings", "favicon"),
}
website_settings = frappe.get_single("Website Settings")
image_fields = ["banner_image", "footer_logo", "favicon"]
for field in image_fields:
website_settings.update({field: get_file_info(website_settings.get(field))})
return website_settings
@frappe.whitelist()