Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

Last modified 15 years ago

#3971 closed defect (fixed)

Empty Milestone

Reported by: markus Owned by: Christian Boos
Priority: normal Milestone: 0.11
Component: roadmap Version: devel
Severity: minor Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Trac 0.11dev tries to render "empty" milestones (see http://trac.edgewall.org/milestone).

  • trac/ticket/roadmap.py

     
    2727from trac.util.text import shorten_line, CRLF, to_unicode
    2828from trac.ticket import Milestone, Ticket, TicketSystem
    2929from trac.Timeline import ITimelineEventProvider
    30 from trac.web import IRequestHandler
     30from trac.web.api import IRequestHandler, HTTPNotFound
    3131from trac.web.chrome import add_link, add_stylesheet, INavigationContributor
    3232from trac.wiki import wiki_to_html, wiki_to_oneliner, IWikiSyntaxProvider
    3333
     
    358358        elif action == 'delete':
    359359            return self._render_confirm(req, db, milestone)
    360360
    361         return self._render_view(req, db, milestone)
     361        if milestone.exists:
     362            return self._render_view(req, db, milestone)
     363        else:
     364            raise HTTPNotFound('Milestone not found')
    362365
    363366    # Internal methods

Creating the corresponding unit test is left as an exercise for the TracTeam. ;-)

Attachments (0)

Change History (6)

comment:1 by Christian Boos, 18 years ago

Milestone: 0.11
Severity: normalminor

Mh, couldn't we do something more useful here, like displaying the "current" milestone?

This is what I do for changesets, looking for /changeset, you'll get the head.

in reply to:  1 ; comment:2 by anonymous, 18 years ago

Replying to cboos:

Mh, couldn't we do something more useful here, like displaying the "current" milestone?

This is what I do for changesets, looking for /changeset, you'll get the head.

What do you mean by current milestone? In other words, what would be Trac's current milestone? 0.9.7, 0.10.1, 0.11? If we really want to avoid returing HttpNotFound, I'd rather redirect to the roadmap…

in reply to:  2 comment:3 by Christian Boos, 18 years ago

Owner: changed from Christopher Lenz to Christian Boos

Replying to anonymous:

Replying to cboos:

Mh, couldn't we do something more useful here, like displaying the "current" milestone?

This is what I do for changesets, looking for /changeset, you'll get the head.

What do you mean by current milestone? In other words, what would be Trac's current milestone? 0.9.7, 0.10.1, 0.11?

Good point, what I had in mind was the use the first milestone in the Roadmap list of opened milestones, but in the case of Trac itself, that would give 0.9.7, which is not really the "current" one (0.11 would be the interesting one).

If we really want to avoid returing HttpNotFound, I'd rather redirect to the roadmap…

Good suggestion. Any other opinion?

comment:4 by Christopher Lenz, 18 years ago

Redirecting to the roadmap sounds good.

comment:5 by Christian Boos, 18 years ago

Resolution: fixed
Status: newclosed

Did so in r4042.

comment:6 by Christian Boos, 18 years ago

Should we do the same for /ticket, and redirect to either /query or /reports?

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.