Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#6043 closed defect (fixed)

Hours and Estimation Fields should be checked for existence

Reported by: anonymous Owned by: Russ Tyndall
Priority: normal Component: TimingAndEstimationPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11


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

---       2009-10-27 18:07:39.000000000 +0100
+++    2009-10-27 18:54:20.000000000 +0100
@@ -166,10 +166,16 @@
         #some european countries use , as the decimal separator
+       except KeyError:
+           ticket['hours'] = 0
+           convertfloat(ticket.values['hours'])
         except ValueError:
             errors.append(('Add Hours to Ticket', 'Value must be a number'))
+       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 (0)

Change History (3)

comment:1 Changed 9 years ago by Russ Tyndall

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

comment:2 Changed 9 years ago by Russ Tyndall

Resolution: fixed
Status: newclosed

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

comment:3 Changed 9 years ago by anonymous


Do you know why the hours are not being transmitted?

Yes, I am hiding the field for the customer.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Russ Tyndall.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.