Opened 18 years ago
Closed 16 years ago
#1376 closed defect (fixed)
No Validation on Time
Reported by: | anonymous | Owned by: | Russ Tyndall |
---|---|---|---|
Priority: | normal | Component: | TimingAndEstimationPlugin |
Severity: | normal | Keywords: | |
Cc: | Filipe Correia | 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 (1)
Change History (10)
comment:1 Changed 18 years ago by
Priority: | high → normal |
---|---|
Severity: | major → normal |
Summary: | When entering time, it crashes if time is not a number → No Validation on Time |
comment:2 follow-up: 4 Changed 17 years ago by
comment:3 Changed 17 years ago by
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.
comment:4 Changed 16 years ago by
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...
comment:5 Changed 16 years ago by
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.
comment:6 Changed 16 years ago by
I'm for the inclusion of this ticket on the next release! Are there any plans in this regard?
comment:7 Changed 16 years ago by
Cc: | Filipe Correia added; anonymous removed |
---|
comment:8 Changed 16 years ago by
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.
Changed 16 years ago by
Attachment: | trac-timingandestimationplugin-validate-input.patch added |
---|
Add backend validation for hours fields
comment:9 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
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.