caljer1 / auto-repair-shop

Automatically exported from code.google.com/p/auto-repair-shop
0 stars 0 forks source link

AttributeError("'tuple' object has no attribute 'extend'") #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. New Customer
2. New Vehicle
3. New Workorder
    workorder is now in OPEN state
4.  Click on that workorder on the Left pane
5.  Change radio button from Open to Completed without changing any
    fields
5.  Save

What is the expected output? What do you see instead?
AttributeError("'tuple' object has no attribute 'extend'")
See attached Customer.html to see the error page
console.txt has the console msgs 
From the console:
checking status...
checking date_closed...
checking vehicle_id...
checking mileage...
checking customer_request...
checking notes...
checking work_performed...
checking mechanic...
checking task_list...
checking date_created...
checking id...

Original issue reported on code.google.com by Les.Faby.78@gmail.com on 12 Jun 2009 at 2:50

Attachments:

GoogleCodeExporter commented 9 years ago
Les, the bug is in your code.  You attempt to extend the tuple 
'requiredWorkOrdAll',
since tuples are not mutable, they can't be extended:

requiredWorkOrd = MaintAppModel.requiredWorkOrdAll
if workOrder.status != Workorder.OPEN:
    requiredWorkOrd.extend(MaintAppModel.requiredWorkOrdDone)

Original comment by bd.gai...@gmail.com on 12 Jun 2009 at 3:42

GoogleCodeExporter commented 9 years ago

Original comment by bd.gai...@gmail.com on 12 Jun 2009 at 9:08

GoogleCodeExporter commented 9 years ago
Thanks for the thorough bug report.

MaintAppModel.requiredWorkOrdDone  was mispelled as reqd......

Made requiredWorkOrd a list()
Before:
    requiredWorkOrd = MaintAppModel.requiredWorkOrdAll
After:
    requiredWorkOrd = list(MaintAppModel.requiredWorkOrdAll)

Original comment by Les.Faby.78@gmail.com on 13 Jun 2009 at 1:53

GoogleCodeExporter commented 9 years ago
Now works on my machine

Original comment by Les.Faby.78@gmail.com on 13 Jun 2009 at 2:04