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
File "/home/user/Workspace/stp6/trac-trunk/trac/web/main.py", line 340, in _post_process_request
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.
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.
@thenor57, moved to trac-hacks#20.