From: Michael Tremer Date: Tue, 18 Oct 2022 16:56:05 +0000 (+0000) Subject: hub: Associate uploads builds with their owner X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=efd3f67712e3bdaa22b7880ba829e81877ff5209;p=pbs.git hub: Associate uploads builds with their owner Signed-off-by: Michael Tremer --- diff --git a/src/hub/builds.py b/src/hub/builds.py index bc41ae45..51823beb 100644 --- a/src/hub/builds.py +++ b/src/hub/builds.py @@ -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()