Code review comment for lp://staging/~james-w/launchpad-work-items-tracker/multi-project

Revision history for this message
James Westby (james-w) wrote :

Found the auto-reset:

   if milestone:
        # get milestone date range
        cur = db.cursor()
        cur.execute('SELECT due_date FROM milestones WHERE name = ?', (milestone,))
        date_end = cur.fetchone()[0]
        cur.execute('SELECT MAX(due_date), MAX(due_date) < date(CURRENT_TIMESTAMP) FROM milestones WHERE due_date < ?', (date_end,))
        (date_start, in_milestone) = cur.fetchone()

        # if we are already within the milestone, start at the previous
        # milestone's end date; if we are before, start at the beginning of the
        # entire cycle, to allow planning
        if in_milestone:
            ms_sql = "AND w.milestone='%s' AND date >= '%s' AND date <= '%s'" % (
                    escape_sql(milestone), date_start, date_end)
        else:
            ms_sql = "AND w.milestone='%s' AND date <= '%s'" % (
                    escape_sql(milestone), date_end)

I'll have to think about that a bit.

Thanks,

James

« Back to merge proposal