refactor: more readable conditional

This commit is contained in:
Hussain Nagaria 2026-04-13 12:56:25 +05:30 committed by GitHub
parent 334d4d971f
commit b354a30aed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -115,7 +115,7 @@ class WebForm(WebsiteGenerator):
def validate_hidden_and_mandatory(self):
for d in self.web_form_fields:
if d.hidden and d.reqd and not d.default and not frappe.flags.in_migrate:
if (d.hidden and d.reqd) and not (d.default or frappe.flags.in_migrate):
frappe.throw(
_("{0}: Field {1} in row {2} cannot be hidden and mandatory without default").format(
self.name, d.label, d.idx