You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by je...@apache.org on 2014/09/18 09:29:40 UTC
[05/43] 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_7656
Commit: e15c415761bb09c7ee12758f578815dd26ca119a
Parents: 64efd59
Author: Igor Bondarenko <je...@gmail.com>
Authored: Wed Sep 3 16:42:08 2014 +0300
Committer: Igor Bondarenko <je...@gmail.com>
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,