fix: false positive attr check while applying permlevel (#20069)
* fix: false positive attr check while applying permlevel * Revert "fix: false positive attr check while applying permlevel" This reverts commit 9114788590ce12be977df847c13b00e3bf72ac2a. * fix: ignore AttributeError while trying to pop low permlevel fields --------- Co-authored-by: Ankush Menat <ankush@frappe.io>
This commit is contained in:
parent
537172ac02
commit
89d63ea82b
1 changed files with 5 additions and 1 deletions
|
|
@ -676,7 +676,11 @@ class Document(BaseDocument):
|
|||
|
||||
for df in self.meta.fields:
|
||||
if df.permlevel and hasattr(self, df.fieldname) and df.permlevel not in has_access_to:
|
||||
delattr(self, df.fieldname)
|
||||
try:
|
||||
delattr(self, df.fieldname)
|
||||
except AttributeError:
|
||||
# hasattr might return True for class attribute which can't be delattr-ed.
|
||||
continue
|
||||
|
||||
for table_field in self.meta.get_table_fields():
|
||||
for df in frappe.get_meta(table_field.options).fields or []:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue