Page MenuHomePhabricator

Create a message for when campaign is over.
Closed, ResolvedPublic

Description

As requested in the parent task we need a message to notify the user of the campaign being over when they try to get a workset.

Event Timeline

Talking to @Zppix in chat, I came up with the following query to quickly check for campaign completion:

SELECT 1 FROM task 
INNER JOIN campaign ON campaign_id = campaign.id 
LEFT JOIN label ON task_id = task.id 
WHERE campaign.id = <campaign ID number> 
GROUP BY task.id 
HAVING COUNT(label.data) < MAX(campaign.labels_per_task) 
LIMIT 1

If it returns a row, then the campaign is not complete. If it can't return a row, the campaign is complete.

Ladsgroup claimed this task.
Ladsgroup subscribed.

This has been done for a very long time now