Return-Path: X-Original-To: apmail-allura-commits-archive@www.apache.org Delivered-To: apmail-allura-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 085531112F for ; Wed, 3 Sep 2014 14:56:39 +0000 (UTC) Received: (qmail 35720 invoked by uid 500); 3 Sep 2014 14:25:49 -0000 Delivered-To: apmail-allura-commits-archive@allura.apache.org Received: (qmail 15348 invoked by uid 500); 3 Sep 2014 14:25:29 -0000 Mailing-List: contact commits-help@allura.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@allura.apache.org Delivered-To: mailing list commits@allura.apache.org Received: (qmail 97507 invoked by uid 99); 3 Sep 2014 14:00:11 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Sep 2014 14:00:11 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id B0E3CA06111; Wed, 3 Sep 2014 14:00:11 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jetmind@apache.org To: commits@allura.apache.org Date: Wed, 03 Sep 2014 14:00:15 -0000 Message-Id: <38ffe3745a654d60bb65de10fb1e5b91@git.apache.org> In-Reply-To: <2e8ba1d71c9744649465f5640a98b0fe@git.apache.org> References: <2e8ba1d71c9744649465f5640a98b0fe@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [5/5] git commit: [#7628] ticket:646 Fix agpl duplicates discovery [#7628] ticket:646 Fix agpl duplicates discovery Project: http://git-wip-us.apache.org/repos/asf/allura/repo Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/e15c4157 Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/e15c4157 Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/e15c4157 Branch: refs/heads/je/42cc_7628 Commit: e15c415761bb09c7ee12758f578815dd26ca119a Parents: 64efd59 Author: Igor Bondarenko Authored: Wed Sep 3 16:42:08 2014 +0300 Committer: Igor Bondarenko Committed: Wed Sep 3 16:42:08 2014 +0300 ---------------------------------------------------------------------- Allura/allura/scripts/remove_duplicate_troves.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/allura/blob/e15c4157/Allura/allura/scripts/remove_duplicate_troves.py ---------------------------------------------------------------------- diff --git a/Allura/allura/scripts/remove_duplicate_troves.py b/Allura/allura/scripts/remove_duplicate_troves.py index 5249498..7866b2e 100644 --- a/Allura/allura/scripts/remove_duplicate_troves.py +++ b/Allura/allura/scripts/remove_duplicate_troves.py @@ -82,10 +82,13 @@ class RemoveDuplicateTroves(ScriptTask): @classmethod def _find_duplicates(cls): - # agpl is present twice with different cat_id - # (update in creation command updated only one of duplicates), - # so code below will not catch it - dups = M.TroveCategory.query.find({'shortname': 'agpl'}).all() + dups = [] + agpl = M.TroveCategory.query.find({'shortname': 'agpl'}).all() + if len(agpl) > 1: + # agpl is present twice with different cat_id + # (update in creation command updated only one of duplicates), + # so code below will not catch it + dups.extend(agpl) for cat in M.TroveCategory.query.find(): if M.TroveCategory.query.find({ 'shortname': cat.shortname,