← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~alvarocs/launchpad:fix-test-charm-metadataurl into launchpad:master

 

Alvaro Crespo Serrano has proposed merging ~alvarocs/launchpad:fix-test-charm-metadataurl into launchpad:master.

Commit message:
Fix preloadBuildsData to use correct CharmFile and LibraryFileAlias attributes

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~alvarocs/launchpad/+git/launchpad/+merge/490680
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~alvarocs/launchpad:fix-test-charm-metadataurl into launchpad:master.
diff --git a/lib/lp/charms/model/charmrecipebuild.py b/lib/lp/charms/model/charmrecipebuild.py
index d015b0f..be05478 100644
--- a/lib/lp/charms/model/charmrecipebuild.py
+++ b/lib/lp/charms/model/charmrecipebuild.py
@@ -597,15 +597,15 @@ class CharmRecipeBuildSet(SpecificBuildFarmJobSourceMixin):
 
         # Prefetch all charms metadata files
         charm_files = load_referencing(CharmFile, builds, ["build_id"])
-        lfas = load_related(LibraryFileAlias, charm_files, ["libraryfile_id"])
+        lfas = load_related(LibraryFileAlias, charm_files, ["library_file_id"])
 
         metadata_files = {}
         for charm_file in charm_files:
             if (
-                charm_file.libraryfile.filename
-                == charm_file.charmbuild.metadata_filename
+                charm_file.library_file.filename
+                == charm_file.build.metadata_filename
             ):
-                metadata_files[charm_file.build_id] = charm_file.libraryfile
+                metadata_files[charm_file.build_id] = charm_file.library_file
 
         for build in builds:
             cache = get_property_cache(build)