Merge pull request #22736 from Thunderbottom/set-homepage
fix: reset homepage to home after unchecking products page
This commit is contained in:
commit
718870f4a2
@ -11,9 +11,9 @@ from frappe.model.document import Document
|
||||
class ProductsSettings(Document):
|
||||
def validate(self):
|
||||
if self.home_page_is_products:
|
||||
website_settings = frappe.get_doc('Website Settings')
|
||||
website_settings.home_page = 'products'
|
||||
website_settings.save()
|
||||
frappe.db.set_value("Website Settings", "home_page", "products")
|
||||
elif frappe.db.get_single_value("Website Settings", "home_page") == 'products':
|
||||
frappe.db.set_value("Website Settings", "home_page", "home")
|
||||
|
||||
self.validate_field_filters()
|
||||
self.validate_attribute_filters()
|
||||
@ -40,4 +40,3 @@ def home_page_is_products(doc, method):
|
||||
home_page_is_products = cint(frappe.db.get_single_value('Products Settings', 'home_page_is_products'))
|
||||
if home_page_is_products:
|
||||
doc.home_page = 'products'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user