refactor: more readable conditional
This commit is contained in:
parent
334d4d971f
commit
b354a30aed
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue