allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [allura] branch master updated: [#7712] fix bulk edit after ticket filter (collaborated with Vrinda A)
Date Wed, 17 Mar 2021 17:22:09 GMT
This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git


The following commit(s) were added to refs/heads/master by this push:
     new 4b35f0a  [#7712] fix bulk edit after ticket filter (collaborated with Vrinda A)
4b35f0a is described below

commit 4b35f0aa75a0e7a434559caba506dd5fd4499923
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
AuthorDate: Wed Mar 17 13:22:01 2021 -0400

    [#7712] fix bulk edit after ticket filter (collaborated with Vrinda A)
---
 Allura/allura/lib/search.py                             | 4 ++++
 ForgeTracker/forgetracker/tests/functional/test_root.py | 7 +++++++
 2 files changed, 11 insertions(+)

diff --git a/Allura/allura/lib/search.py b/Allura/allura/lib/search.py
index 4c5dab9..462ffc2 100644
--- a/Allura/allura/lib/search.py
+++ b/Allura/allura/lib/search.py
@@ -17,6 +17,8 @@
 
 from __future__ import unicode_literals
 from __future__ import absolute_import
+
+import ast
 import re
 import socket
 from logging import getLogger
@@ -172,6 +174,8 @@ def search_artifact(atype, q, history=False, rows=10, short_timeout=False,
filte
         fq.append('project_id_s:%s' % c.project._id)
 
     fq += kw.pop('fq', [])
+    if isinstance(filter, six.string_types):  # may be stringified after a ticket filter,
then bulk edit
+        filter = ast.literal_eval(filter)
     for name, values in six.iteritems((filter or {})):
         field_name = name + '_s'
         parts = []
diff --git a/ForgeTracker/forgetracker/tests/functional/test_root.py b/ForgeTracker/forgetracker/tests/functional/test_root.py
index 587d5c8..e6155b1 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -1683,6 +1683,13 @@ class TestFunctionalController(TrackerTestController):
         assert_in('test second ticket', ticket_rows.text)
         assert_false('test third ticket' in ticket_rows.text)
 
+    def test_bulk_edit_after_filtering(self):
+        self.new_ticket(summary='test first ticket', status='open')
+        ThreadLocalORMSession.flush_all()
+        M.MonQTask.run_ready()
+        ThreadLocalORMSession.flush_all()
+        self.app.get("/p/test/bugs/edit/?q=test&limit=25&sort=&page=0&filter={'status'%3A+['open']}")
+
     def test_new_ticket_notification_contains_attachments(self):
         file_name = 't├ęst_root.py'.encode('utf-8')
         file_data = open(__file__, 'rb').read()


Mime
View raw message