[arch-projects] [archweb] [PATCH] Fix auto-adoption
Look up the packager using the UserFinder class, and create a PackageRelation. Signed-off-by: Johannes Löthberg <johannes@kyriasis.com> --- devel/management/commands/reporead.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/devel/management/commands/reporead.py b/devel/management/commands/reporead.py index 6e26710..3ebd45c 100644 --- a/devel/management/commands/reporead.py +++ b/devel/management/commands/reporead.py @@ -396,10 +396,13 @@ def db_update(archname, reponame, pkgs, force=False): with transaction.atomic(): populate_pkg(dbpkg, pkg, timestamp=timestamp) Update.objects.log_update(None, dbpkg) - prel = PackageRelation(pkgbase=dbpkg.pkgbase, - user=dbpkg.packager, - type=PackageRelation.MAINTAINER) - prel.save() + + packager = finder.find(pkg.packager) + if packager: + prel = PackageRelation(pkgbase=dbpkg.pkgbase, + user=packager, + type=PackageRelation.MAINTAINER) + prel.save() except IntegrityError: -- 2.10.2
participants (1)
-
Johannes Löthberg