Reset home page based on product settings (#22876)

This commit is contained in:
Nabin Hait 2020-08-03 10:43:56 +05:30 committed by GitHub
parent 826158c792
commit 1a64d1a4ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,9 +11,9 @@ from frappe.model.document import Document
class ProductsSettings(Document):
def validate(self):
if self.home_page_is_products:
frappe.db.set_value("Website Settings", "home_page", "products")
frappe.db.set_value("Website Settings", None, "home_page", "products")
elif frappe.db.get_single_value("Website Settings", "home_page") == 'products':
frappe.db.set_value("Website Settings", "home_page", "home")
frappe.db.set_value("Website Settings", None, "home_page", "home")
self.validate_field_filters()
self.validate_attribute_filters()