Author: astaric Date: Wed Aug 21 10:13:00 2013 New Revision: 1516129 URL: http://svn.apache.org/r1516129 Log: QCT: Create product tickets in product env.
If ticket is created in global environment, but with product field specified, returned ticket id is invalid. When product specific ticket id is queried from the database, the query returns no results if it is executed in environment that does not contain the ticket. Modified: bloodhound/branches/bep_0010_ticket_numbering/bloodhound_theme/bhtheme/theme.py Modified: bloodhound/branches/bep_0010_ticket_numbering/bloodhound_theme/bhtheme/theme.py URL: http://svn.apache.org/viewvc/bloodhound/branches/bep_0010_ticket_numbering/bloodhound_theme/bhtheme/theme.py?rev=1516129&r1=1516128&r2=1516129&view=diff ============================================================================== --- bloodhound/branches/bep_0010_ticket_numbering/bloodhound_theme/bhtheme/theme.py (original) +++ bloodhound/branches/bep_0010_ticket_numbering/bloodhound_theme/bhtheme/theme.py Wed Aug 21 10:13:00 2013 @@ -551,7 +551,16 @@ class QuickCreateTicketDialog(Component) PS: Borrowed from XmlRpcPlugin. """ - t = Ticket(self.env) + if 'product' in attributes: + if attributes['product']: + env = ProductEnvironment(self.env, attributes['product']) + else: + # Global product + env = self.env.parent or self.env + else: + env = self.env + + t = Ticket(env) t['summary'] = summary t['description'] = description t['reporter'] = req.authname @@ -563,7 +572,7 @@ class QuickCreateTicketDialog(Component) if notify: try: - tn = TicketNotifyEmail(self.env) + tn = TicketNotifyEmail(env) tn.notify(t, newticket=True) except Exception, e: self.log.exception("Failure sending notification on creation "