Opened 8 years ago

Last modified 8 years ago

defect #101 (closed: DONE)

Cannot save changes to dates of completion

Test Complete Size: 1 Test Complete Date: 05/17/2009
Documentation Complete Size: 0 Documentation Complete Date:
Acceptance Complete Size: 1 Acceptance Complete Date: 05/18/2009
Reported by: dfraser Owned by: ja11sop
Milestone: Clean up of Plugin with Patch Component: agile-trac.org
Version: Keywords:
Cc: Blocked By:
Blocking: Patch SVN Revision: 275
Patch Trac Version: not_applicable
In Iterations: 21 22

Description

I got a traceback whenever trying to save the date, because it comes through as a string. The attached patch parses it

Attachments

dates-parsing.patch Download (2.1 KB) - added by dfraser 8 years ago.
Patch to parse dates on submission (version 2)

Change History

Have a look at the list of modified files related to this ticket.

  Changed 8 years ago by dfraser

Hmmm, there's more, will attach a new patch, but saving the traceback here for reference:

How to Reproduce

While doing a POST operation on /ticket/1785, Trac issued an internal error.

(please provide additional details here)

Request parameters:

{'__FORM_TOKEN': u'aa5d011080bc01f5726b288f',
 'action': u'progress',
 'cnum': u'5',
 'comment': u'',
 'field_browser': u'All',
 'field_cc': u'',
 'field_component': u'j5 Core',
 'field_customer': u'',
 'field_description': u'Start j5.\r\nLogin (I used admin/test).\r\nGo to "Preferences", change the password.\r\nLogout/login to verify password change.\r\nStop/restart j5.\r\nLogin again -- note that you need to use the old password.\r\n\r\nIt looks like the new password is not being saved to the .config file.',
 'field_iteration': u'current',
 'field_keywords': u'',
 'field_milestone': u'j5 1.8',
 'field_priority': u'critical',
 'field_reporter': u'ddurrett',
 'field_summary': u'Password changes via "Preferences" don\'t persist',
 'field_type': u'defect',
 'field_version': u'1.8.x',
 'id': u'1785',
 'preview': True,
 'progress_acceptance_complete_date': u'04/23/09',
 'progress_test_complete_date': u'04/23/09',
 'replyto': u'',
 'submit': u'Submit changes',
 'ts': u'2009-04-23 10:55:13+00:00'}

User Agent was: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.8) Gecko/2009032711 Ubuntu/8.10 (intrepid) Firefox/3.0.8

System Information

Trac 0.11.3
Python 2.5 (r25:51908, Mar 9 2009, 08:46:24)
[GCC 4.1.2 20070925 (Red Hat 4.1.2-27)]
setuptools 0.6c7
SQLite 3.4.2
pysqlite 2.3.3
Genshi 0.5
mod_python 3.3.1
Pygments 0.9
Subversion 1.4.4 (r25188)
jQuery: 1.2.6

Python Traceback

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/trac/web/main.py", line 435, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.5/site-packages/trac/web/main.py", line 205, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.5/site-packages/trac/ticket/web_ui.py", line 185, in process_request
    return self._process_ticket_request(req)
  File "/usr/lib/python2.5/site-packages/trac/ticket/web_ui.py", line 534, in _process_ticket_request
    get_reporter_id(req, 'author'), field_changes)
  File "/usr/lib/python2.5/site-packages/trac/ticket/web_ui.py", line 1248, in _insert_ticket_data
    req, ticket, action)
  File "build/bdist.linux-x86_64/egg/agiletrac/workflow.py", line 380, in render_ticket_action_control
    value=(date and format_date(date))),
  File "/usr/lib/python2.5/site-packages/trac/util/datefmt.py", line 138, in format_date
    return format_datetime(t, format, tzinfo=tzinfo)
  File "/usr/lib/python2.5/site-packages/trac/util/datefmt.py", line 106, in format_datetime
    t = to_datetime(t, tzinfo).astimezone(tz)
  File "/usr/lib/python2.5/site-packages/trac/util/datefmt.py", line 51, in to_datetime
    type(t))
TypeError: expecting datetime, int, long, float, or None; got <type 'unicode'>

Changed 8 years ago by dfraser

Patch to parse dates on submission (version 2)

follow-up: ↓ 4   Changed 8 years ago by ja11sop

Many thanks for the patch! Can you let us know which database you are using? It might be that a regression was introduced (without having had time to delve into this yet) as part of the changes for postgresql 8.3. Regardless we'll see about applying this patch as soon as possible once it is reproduced in house. Thanks again.

  Changed 8 years ago by ja11sop

in reply to: ↑ 2   Changed 8 years ago by dfraser

Replying to ja11sop:

Many thanks for the patch! Can you let us know which database you are using? It might be that a regression was introduced (without having had time to delve into this yet) as part of the changes for postgresql 8.3. Regardless we'll see about applying this patch as soon as possible once it is reproduced in house. Thanks again.

Sure :-) - I'm using sqlite

  Changed 8 years ago by ja11sop

  • test_complete_date set to 05/17/09

  Changed 8 years ago by ja11sop

Patch is applied to latest SVN. I also added a change to ticket.html. Can you please verify if this works for you?

  Changed 8 years ago by dfraser

Yes, confirmed that this works great, thanks!

  Changed 8 years ago by ja11sop

  • acceptance_complete_date set to 05/18/09

No, thank you ;-)

Note: See TracTickets for help on using tickets.