Skip to content
Snippets Groups Projects
Commit 1252097e authored by Peter Rotich's avatar Peter Rotich
Browse files

Merge pull request #2617 from protich/issue/expiredlocks

locks: Exclude expired locks via constrain
parents 934cde36 6e507d4c
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,11 @@ if (!$thisstaff->hasPerm(SearchBackend::PERM_EVERYTHING)) {
$tickets->filter(Q::any($visibility));
}
$tickets->constrain(array('lock' => array(
'lock__expire__gt' => SqlFunction::NOW())));
$tickets->annotate(array(
'collab_count' => SqlAggregate::COUNT('thread__collaborators', true),
'attachment_count' => SqlAggregate::COUNT(SqlCase::N()
......
......@@ -319,6 +319,11 @@ $tickets->annotate(array(
->aggregate(array('count' => SqlAggregate::COUNT('entries__id'))),
));
// Make sure we're only getting active locks
$tickets->constrain(array('lock' => array(
'lock__expire__gt' => SqlFunction::NOW())));
?>
<!-- SEARCH FORM START -->
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment