allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [23/50] git commit: [#4940] Simplied taskd only / exclude query and made only take precedence
Date Wed, 19 Sep 2012 18:43:27 GMT
[#4940] Simplied taskd only / exclude query and made only take precedence

Signed-off-by: Cory Johns <johnsca@geek.net>


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/7ab3d6b6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/7ab3d6b6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/7ab3d6b6

Branch: refs/heads/master
Commit: 7ab3d6b67ae05d702eaccd991204c036d64c3401
Parents: 7f4ce46
Author: Cory Johns <johnsca@geek.net>
Authored: Fri Sep 14 18:54:11 2012 +0000
Committer: Cory Johns <johnsca@geek.net>
Committed: Fri Sep 14 18:54:11 2012 +0000

----------------------------------------------------------------------
 Allura/allura/model/monq_model.py |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7ab3d6b6/Allura/allura/model/monq_model.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/monq_model.py b/Allura/allura/model/monq_model.py
index 94fe9a1..d22d65e 100644
--- a/Allura/allura/model/monq_model.py
+++ b/Allura/allura/model/monq_model.py
@@ -159,14 +159,10 @@ class MonQTask(MappedClass):
         while True:
             try:
                 query = dict(state=state)
+                if exclude:
+                    query['task_name'] = {'$nin': exclude}
                 if only:
                     query['task_name'] = {'$in': only}
-                if exclude:
-                    nin = {'$nin': exclude}
-                    if 'task_name' not in query:
-                        query['task_name'] = nin
-                    else:
-                        query['task_name'] = {'$and': [query['task_name'], nin]}
                 obj = cls.query.find_and_modify(
                     query=query,
                     update={


Mime
View raw message