Hi,
I see some redirect have been written in function, such as ticket
_do_save function:
def _do_save(self, req, ticket, action):
# Save the action controllers we need to call side-effects for before
# we save the changes to the ticket.
controllers = list(self._get_action_controllers(req, ticket, action))
# -- Save changes
fragment = ''
now = datetime.now(utc)
cnum = ticket.save_changes(get_reporter_id(req, 'author'),
req.args.get('comment'), when=now,
replyto=req.args.get('replyto'))
if cnum:
fragment = '#comment:%d' % cnum
try:
tn = TicketNotifyEmail(self.env)
tn.notify(ticket, newticket=False, modtime=now)
except Exception, e:
self.log.error("Failure sending notification on change to "
"ticket #%s: %s", ticket.id, exception_to_unicode(e))
# TRANSLATOR: The 'change' has been saved... (link)
change = _('change')
if fragment:
change = tag.a(change, href=fragment)
add_warning(req, tag_("The %(change)s has been saved, but an "
"error occurred while sending "
"notifications: %(message)s",
change=change, message=to_unicode(e)))
fragment = ''
# After saving the changes, apply the side-effects.
for controller in controllers:
self.log.debug("Side effect for %s" %
controller.__class__.__name__)
controller.apply_action_side_effects(req, ticket, action)
_*/req.redirect(req.href.ticket(ticket.id) + fragment)/*_
My question is could i redirect to home page writing some handler not
rewrite this function only modify redirect which with underline?
Thanks,
Charlie
--
You received this message because you are subscribed to the Google Groups "Trac
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/trac-dev.
For more options, visit https://groups.google.com/d/optout.