Ticket #6043 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

Hours and Estimation Fields should be checked for existence

Reported by: anonymous Assigned to: bobbysmith007
Priority: normal Component: TimingAndEstimationPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

A KeyError?-exception occurs if the fields hours and estimation are not transmitted. Therefore it should be checked if the fields exist:

--- ticket_daemon.py.orig       2009-10-27 18:07:39.000000000 +0100
+++ ticket_daemon.py    2009-10-27 18:54:20.000000000 +0100
@@ -166,10 +166,16 @@
         #some european countries use , as the decimal separator
         try:
             convertfloat(ticket.values['hours'])
+       except KeyError:
+           ticket['hours'] = 0
+           convertfloat(ticket.values['hours'])
         except ValueError:
             errors.append(('Add Hours to Ticket', 'Value must be a number'))
         try:
             convertfloat(ticket.values['estimatedhours'])
+       except KeyError:
+           ticket['estimatedhours'] = 0
+           convertfloat(ticket.values['estimatedhours'])
         except ValueError:
             errors.append(('Estimated Number of Hours', 'Value must be a number'))
         return errors

Attachments

Change History

10/27/09 19:19:55 changed by bobbysmith007

While this would certainly work, it would seem that there is some other error going on if the hours field is not transmitted. Do you know why the hours are not being transmitted?

I will have this patch committed soon

10/27/09 19:31:20 changed by bobbysmith007

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

(In [6902]) fixes #6043 during ticket field validation dont throw exceptions if the field isnt there

10/28/09 11:45:11 changed by anonymous

Thanks!

Do you know why the hours are not being transmitted?

Yes, I am hiding the field for the customer.


Add/Change #6043 (Hours and Estimation Fields should be checked for existence)




Change Properties
Action