Modify

Opened 18 months ago

Closed 18 months ago

Last modified 18 months ago

#13011 closed defect (fixed)

When cost field is empty, TypeError float() argument must be a string or a number

Reported by: Kirk Owned by: Kirk
Priority: normal Component: BudgetingPlugin
Severity: normal Keywords:
Cc: Trac Release: 1.2

Description

trac error log

2016-12-22 07:50:43,835 Trac[ticketbudgeting] ERROR: Error executing SQL Statement SELECT position, username, type, estimation, cost, status,
 comment FROM budgeting WHERE ticket=2318 ORDER BY position 
 Error: ('budgeting.cost', TypeError('float() argument must be a string or a number',))

Attachments (0)

Change History (3)

comment:1 Changed 18 months ago by Kirk

Fix:

Index: ticketbudgeting/ticketbudgeting.py
===================================================================
--- ticketbudgeting/ticketbudgeting.py	(revision 16144)
+++ ticketbudgeting/ticketbudgeting.py	(working copy)
@@ -52,7 +52,7 @@
 def get_float(value, fld='UNKNOWN FIELD'):
     ret_val = 0
     try:
-        if value == '':
+        if value is None or value == '':
             ret_val = 0
         else:
             try:

comment:2 Changed 18 months ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

In 16145:

0.6.6dev: Fix TypeError with empty cost field

Patch by linefeed. Fixes #13011.

comment:3 Changed 18 months ago by Ryan J Ollos

Owner: changed from Franz to Kirk

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Kirk.
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.