Ticket #1376 (closed defect: fixed)

Opened 6 years ago

Last modified 4 years ago

No Validation on Time

Reported by: anonymous Assigned to: bobbysmith007
Priority: normal Component: TimingAndEstimationPlugin
Severity: normal Keywords:
Cc: fcorreia@gmail.com Trac Release: 0.10

Description

When I put e.g. "3h" in "add hours to ticket", it shows following screen:

Traceback (most recent call last):

File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 387, in dispatch_request

dispatcher.dispatch(req)

File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 237, in dispatch

resp = chosen_handler.process_request(req)

File "/usr/lib/python2.4/site-packages/trac/ticket/web_ui.py", line 279, in process_request

self._do_save(req, db, ticket)

File "/usr/lib/python2.4/site-packages/trac/ticket/web_ui.py", line 546, in _do_save

cnum=internal_cnum):

File "/usr/lib/python2.4/site-packages/trac/ticket/model.py", line 262, in save_changes

listener.ticket_changed(self, comment, author, old_values)

File "build/bdist.linux-i686/egg/timingandestimationplugin/ticket_daemon.py", line 100, in ticket_changed File "build/bdist.linux-i686/egg/timingandestimationplugin/ticket_daemon.py", line 62, in watch_hours File "build/bdist.linux-i686/egg/timingandestimationplugin/ticket_daemon.py", line 53, in readTicketValue

ValueError?: invalid literal for float(): 3h

Validation should be added.

Attachments

trac-timingandestimationplugin-validate-input.patch (1.7 kB) - added by anonymous on 01/27/09 20:28:37.
Add backend validation for hours fields

Change History

03/22/07 16:25:36 changed by bobbysmith007

  • priority changed from high to normal.
  • severity changed from major to normal.
  • summary changed from When entering time, it crashes if time is not a number to No Validation on Time.

(follow-up: ↓ 4 ) 10/22/07 10:51:38 changed by anonymous

It would also be great if times could be converted from "0,5" to "0.5", so that swedish users can use their numerical keypad.

11/16/07 01:49:57 changed by anonymous

Note: at present it is possible to reduce the hours worked on a ticket, for example if you made a mistake and typed 35 instead of 3.5 hours. This is a helpful feature and should be preserved if possible.

(in reply to: ↑ 2 ) 09/10/08 15:55:14 changed by bobbysmith007

Replying to anonymous:

It would also be great if times could be converted from "0,5" to "0.5", so that swedish users can use their numerical keypad.

This is now available for data entry...

11/05/08 02:28:57 changed by anonymous

I suggest you look at my patch for time integer custom fields http://trac.edgewall.org/attachment/wiki/TimeTracking/CustomFields0.11Rev7651.patch

This is a good place to start for adding some client side validation. Server side I'm not sure about.

01/03/09 13:28:11 changed by FilipeCorreia

I'm for the inclusion of this ticket on the next release! Are there any plans in this regard?

01/03/09 13:28:32 changed by anonymous

  • cc set to fcorreia@gmail.com.

01/27/09 20:27:45 changed by anonymous

While javascript can be a nice addition to the user experience, it should _never_ be used as a substitute for proper back end validation. I'm attaching a patch that adds validation on the back end, should apply cleanly to trunk.

01/27/09 20:28:37 changed by anonymous

  • attachment trac-timingandestimationplugin-validate-input.patch added.

Add backend validation for hours fields

01/28/09 12:24:22 changed by bobbysmith007

  • status changed from new to closed.
  • resolution set to fixed.

(In [5162]) closes #1376 Much thanks to Anonymous for the patch!

Adds standard trac validation on the ticket hours and estimated hours fields New version is 0.7.6 and available


Add/Change #1376 (No Validation on Time)




Change Properties
Action