Skip to content

Commit

Permalink
fix: Use correct filename with suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
ewuerger committed Oct 23, 2024
1 parent 9e10ae7 commit 1e0589e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions capella2polarion/converters/element_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,17 +323,18 @@ def repair_images(node: etree._Element) -> None:
try:
with filehandler.open(file_path, "r") as img:
content = img.read()
file_name = hashlib.md5(
str(file_path).encode("utf8")
).hexdigest()
file_name = (
hashlib.md5(str(file_path).encode("utf8")).hexdigest()
+ file_path.suffix
)
attachments.append(
polarion_api.WorkItemAttachment(
"",
"",
file_path.name,
content,
mime_type,
f"{file_name}.{file_path.suffix}",
file_name,
)
)
node.attrib["src"] = f"workitemimg:{file_name}"
Expand Down

0 comments on commit 1e0589e

Please sign in to comment.