Author: rjollos Date: Fri Jul 12 00:49:29 2013 New Revision: 1502405 URL: http://svn.apache.org/r1502405 Log: Prevent existing ticket from being opened via the `/newticket` URL. Fixes #577.
This makes effective for the `ProductTicketModule` a change that was made in Trac for the `TicketModule`, first introduced in t:#5022, backed-out and then reintroduced in [t 6835]. Now existing tickets can't be opened through a URL matching `/newticket\?id=\d+`, instead a `TracError` will be raised. Patch by Olemis. Modified: bloodhound/trunk/bloodhound_multiproduct/multiproduct/ticket/web_ui.py Modified: bloodhound/trunk/bloodhound_multiproduct/multiproduct/ticket/web_ui.py URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/multiproduct/ticket/web_ui.py?rev=1502405&r1=1502404&r2=1502405&view=diff ============================================================================== --- bloodhound/trunk/bloodhound_multiproduct/multiproduct/ticket/web_ui.py (original) +++ bloodhound/trunk/bloodhound_multiproduct/multiproduct/ticket/web_ui.py Fri Jul 12 00:49:29 2013 @@ -54,8 +54,7 @@ class ProductTicketModule(TicketModule): productid = req.args.get('productid','') if ticketid: - if (req.path_info == '/products/' + productid + '/newticket' or - req.path_info == '/products'): + if req.path_info in ('/newticket', '/products'): raise TracError(_("id can't be set for a new ticket request.")) ticket = Ticket(self.env, ticketid) if productid and ticket['product'] != productid: