Traceback while auto-previewing a new ticket if a parent ticket doesn't exist #27

Closed
rjollos opened this Issue Oct 22, 2012 · 1 comment

Projects

None yet

1 participant

@rjollos
Contributor
rjollos commented Oct 22, 2012

The following traceback can be seen in the console if a non-existent parent ticket is added to a newticket and the page is allowed to auto-preview. If the preview button is pressed, then the user is redirected to /newticket#ticket and an error message is displayed.

09:05:43 PM Trac[api] ERROR: Ticket 5 does not exist.
09:05:43 PM Trac[main] ERROR: Exception caught while post-processing request: 
Traceback (most recent call last):
  File "/home/user/Workspace/stp6/trac-trunk/trac/web/main.py", line 243, in dispatch
    self._post_process_request(req)
  File "/home/user/Workspace/stp6/trac-trunk/trac/web/main.py", line 340, in _post_process_request
    f.post_process_request(req, *(None,)*extra_arg_count)
  File "build/bdist.linux-i686/egg/tracsubtickets/web_ui.py", line 65, in post_process_request
    ticket = data['ticket']
TypeError: 'NoneType' object is unsubscriptable
09:05:43 PM Trac[main] WARNING: [127.0.0.1] HTTPNotFound: 404 Invalid ticket number (Ticket 5 does not exist.)
127.0.0.1 - - [21/Oct/2012 21:05:43] "POST /tracdev/newticket HTTP/1.1" 404 -

The desirable behavior would be to show a warning message at the top of the page when Preview is pressed. If some fixes are applied in validate_ticket, then it should function this way.

@rjollos rjollos added a commit to rjollos/trac-subtickets-plugin that referenced this issue Oct 22, 2012
@rjollos rjollos Refs #27: Modified `validate_ticket` so that individual messages are …
…reported for each valid ticket and the parent list is fixed-up to remove all invalid ticket. Modified `post_process_request` to avoid an exception during auto-preview.
f7e4683
Contributor
rjollos commented Feb 10, 2017
@rjollos rjollos closed this Feb 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment