#5355 (Duration is None but should be 0:00)
by Luc Saffre · in Developers · assigned to Luc Saffre
Summary
We have this on Jane. Seems that DurationField stores a None when it gets "0:00"
Children
Comments
- 2 years, 9 months ago by Luc Saffre about #5355 (Duration is None but should be 0:00) : All test suites passed (on my computer) and I pushed my changes.
- 2 years, 9 months ago by Luc Saffre about #5355 (Duration is None but should be 0:00) : A side effect and positive confirmation of this bugfix is that the working time summary collectors needed adaptation because now there is a difference between "0:00" and None.
- 2 years, 9 months ago by Luc Saffre about #5355 (Duration is None but should be 0:00) : Ha! I found it! QuantityField.get_prep_value() was returning an empty string when "not value", ignoring that Duration("0:00") evaluates to boolean false.
- 2 years, 9 months ago by Luc Saffre about #5355 (Duration is None but should be 0:00) : I have the issue reproduced. But didn't yet find how to fix it. Seems that durations of 0:00 get stored as None in the database.
- 2 years, 9 months ago by Luc Saffre about #5355 (Duration is None but should be 0:00) : I tried to write a test case to reproduce the issue. Did not yet succeed...
- 2 years, 9 months ago by Luc Saffre about #5355 (Duration is None but should be 0:00) : Created new Ticket #5355 (Duration is None but should be 0:00).