This is an automated email from the ASF dual-hosted git repository.

gcruz 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 0c3ea1ce1 [#8434] tickets search results count change reverted
0c3ea1ce1 is described below

commit 0c3ea1ce1a182a9f564e99d1e2b90ee3316eaf66
Author: Guillermo Cruz <[email protected]>
AuthorDate: Fri Jun 3 13:58:06 2022 -0600

    [#8434] tickets search results count change reverted
---
 ForgeTracker/forgetracker/model/ticket.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/ForgeTracker/forgetracker/model/ticket.py 
b/ForgeTracker/forgetracker/model/ticket.py
index a67ed48e1..34aa72e94 100644
--- a/ForgeTracker/forgetracker/model/ticket.py
+++ b/ForgeTracker/forgetracker/model/ticket.py
@@ -1306,6 +1306,7 @@ class Ticket(VersionedArtifact, ActivityObject, 
VotableArtifact):
             solr_error = e
             matches = None
         if matches:
+            count = matches.hits
             # ticket_matches is in sorted order
             ticket_matches = [ObjectId(match['id'].split('#')[1]) for match in 
matches.docs]
             query = cls.query.find(
@@ -1316,7 +1317,6 @@ class Ticket(VersionedArtifact, ActivityObject, 
VotableArtifact):
                 ticket_by_id[t._id] = t
             # and pull them out in the order given by ticket_numbers
             tickets = []
-            count = 0
             for t_id in ticket_matches:
                 if t_id in ticket_by_id:
                     show_deleted = show_deleted and security.has_access(
@@ -1325,7 +1325,6 @@ class Ticket(VersionedArtifact, ActivityObject, 
VotableArtifact):
                                             app_config.project.root_project if 
app_config else None) and
                             (show_deleted or ticket_by_id[t_id].deleted is 
False)):
                         tickets.append(ticket_by_id[t_id])
-                        count = count + 1
                     else:
                         count = count - 1
         return dict(tickets=tickets,

Reply via email to