From: Kevin C. <ke...@us...> - 2005-12-23 23:39:43
|
Update of /cvsroot/mailmanager/MailManager/Extensions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4833/Extensions Modified Files: Tag: RELENG_2_0_1 TicketPluggableBrain.py Log Message: Bugfix for Create Ticket fails when logged in as customer (#1369356) Index: TicketPluggableBrain.py =================================================================== RCS file: /cvsroot/mailmanager/MailManager/Extensions/TicketPluggableBrain.py,v retrieving revision 1.6.2.7 retrieving revision 1.6.2.8 diff -u -d -r1.6.2.7 -r1.6.2.8 --- TicketPluggableBrain.py 16 Dec 2005 15:23:27 -0000 1.6.2.7 +++ TicketPluggableBrain.py 23 Dec 2005 23:39:35 -0000 1.6.2.8 @@ -3,6 +3,7 @@ from AccessControl import ClassSecurityInfo, getSecurityManager from DateTime import DateTime from zExceptions.unauthorized import Unauthorized +from zExceptions import BadRequest # Modules from this package from Products.MailManager.MailMixin import MailMixin @@ -296,6 +297,14 @@ REQUEST.set('flag_mail_to', 1) return self.ticket_index_html(self, REQUEST) raise BadRequest, 'The To field may not be empty' + + if not self.validEmail(mail_to): + if REQUEST is not None: + REQUEST.set('error', '%s is not a valid email address.' % mail_to) + REQUEST.set('flag_mail_to', 1) + return self.ticket_index_html(self, REQUEST) + raise BadRequest, 'The To field may not be empty' + if self.sql.listTickets(support_of=self.id, status=['open', 'hold']): if REQUEST is not None: @@ -337,6 +346,14 @@ REQUEST.set('flag_mail_to', 1) return self.ticket_index_html(self, REQUEST) raise BadRequest, 'The To field may not be empty' + + if not self.validEmail(mail_to): + if REQUEST is not None: + REQUEST.set('error', '%s is not a valid email address.' % mail_to) + REQUEST.set('flag_mail_to', 1) + return self.ticket_index_html(self, REQUEST) + raise BadRequest, 'The To field may not be empty' + # The first time we reply check promptness. if not self.date_responded: self.sql.setDateResponded(id=self.id) |