]> git.ipfire.org Git - pbs.git/commitdiff
hub: Associate uploads builds with their owner
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 18 Oct 2022 16:56:05 +0000 (16:56 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 18 Oct 2022 16:56:05 +0000 (16:56 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/hub/builds.py

index bc41ae45799800fed1ef0642c01d8626c8cd345a..51823bebf54066ec036a17ee77af57807aa22ae8 100644 (file)
@@ -41,21 +41,15 @@ class CreateHandler(BaseHandler):
                        # Extract the package metadata
                        package = archive.get_package()
 
-                       # Find the distribution
-                       #distro = self.backend.distros.get_by_slug(package.distribution)
-                       #if not distro:
-                       #       raise tornado.web.HTTPError(400,
-                       #               "Could not find distribution %s" % package.distribution)
-
-                       # XXX debug
-                       distro = self.backend.distros.get_by_id(1)
-                       repo   = self.backend.repos.get_by_id(1)
-
                        # Import the package
                        package = await self.backend.packages.create(archive)
 
+                       # XXX Fetch the distribution
+                       # XXX Fetch the repository
+                       repo = self.backend.repos.get_by_id(1)
+
                        # Create a new build
-                       build = self.backend.builds.create(repo, package)
+                       build = self.backend.builds.create(repo, package, owner=self.user)
 
                        # Delete the upload
                        await upload.delete()