Use function to not copy custom report content
The Function fields are not copied so it is the storage field that must have a default value. Closes #13170
This commit is contained in:
@@ -685,16 +685,10 @@ class ActionReport(
|
||||
default = {}
|
||||
default = default.copy()
|
||||
default.setdefault('module', None)
|
||||
|
||||
new_reports = []
|
||||
for report in reports:
|
||||
if report.report:
|
||||
default['report_content'] = None
|
||||
default['report'] = None
|
||||
default['report_name'] = report.report_name
|
||||
new_reports.extend(super(ActionReport, cls).copy([report],
|
||||
default=default))
|
||||
return new_reports
|
||||
default.setdefault(
|
||||
'report_content_custom',
|
||||
lambda o: None if o['report'] else o['report_content_custom'])
|
||||
return super().copy(reports, default=default)
|
||||
|
||||
@classmethod
|
||||
def write(cls, reports, values, *args):
|
||||
|
||||
Reference in New Issue
Block a user