Skip to content

Commit 8f63281

Browse files
AyanSinhaMahapatraalok1304
authored andcommitted
Refactor code using resource.extracted_from function
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com> Signed-off-by: Alok Kumar <alokkumarjipura9973@gmail.com>
1 parent b3fb605 commit 8f63281

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/packagedcode/models.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,8 +1222,7 @@ def assign_package_to_resources(cls, package, resource, codebase, package_adder=
12221222
# update `for_packages` of a codebase resource.
12231223
package_uid = package.package_uid
12241224
if resource.path.endswith("-extract"):
1225-
archive_resource_path = resource.path.removesuffix("-extract")
1226-
archive_resource = codebase.get_resource(archive_resource_path)
1225+
archive_resource = resource.extracted_from(codebase)
12271226
if archive_resource:
12281227
package_adder(package_uid, archive_resource, codebase)
12291228

0 commit comments

Comments
 (0)