Skip to content

Commit

Permalink
Merge pull request #324 from multiflexi/fix_value_description
Browse files Browse the repository at this point in the history
fix error when adding CWE
  • Loading branch information
Progress1 authored Jul 25, 2024
2 parents c45b773 + e8faa0b commit e6e0752
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/model/report_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ def update_report_item(cls, id, data, user):
if "add" in data:
if "attribute_id" in data:
modified = True
new_attribute = ReportItemAttribute(None, "", None, 0, None, data["attribute_group_item_id"], None)
new_attribute = ReportItemAttribute(None, "", "", None, 0, None, data["attribute_group_item_id"], None)
new_attribute.user = user
report_item.attributes.append(new_attribute)

Expand Down Expand Up @@ -861,7 +861,9 @@ def add_attachment(cls, id, attribute_group_item_id, user, file, description):
"""
report_item = cls.query.get(id)
file_data = file.read()
new_attribute = ReportItemAttribute(None, file.filename, file.mimetype, len(file_data), description, attribute_group_item_id, None)
new_attribute = ReportItemAttribute(
None, file.filename, "", file.mimetype, len(file_data), description, attribute_group_item_id, None
)
new_attribute.user = user
new_attribute.binary_data = file_data
report_item.attributes.append(new_attribute)
Expand Down

0 comments on commit e6e0752

Please sign in to comment.