[#1569] Crash if you try to save a project with negativ time (sqlite3.IntegrityError: constraint failed)

Date:
2010-09-01 07:16
Priority:
3
State:
Open
Submitted by:
Bjoern Schilberg (bjoern)
Assigned to:
Nobody (None)
Hardware:
none
Product:
none
Operating System:
Linux
Component:
none
Version:
none
Severity:
major
Resolution:
Fixed
URL:
Summary:
Crash if you try to save a project with negativ time (sqlite3.IntegrityError: constraint failed)

Detailed description
To reproduce the error:
- Start getan
- Choose an start a project
- Subtract a time bigger than the actual time
- e.g. -20 min
- Store / Save the project and enter a descpription
- Hit return

Getan Version: parent: 33:f96a18c10836 tip
Python 2.5.2


Traceback (most recent call last):
File "./getan.py", line 164, in <module>
main()
File "./getan.py", line 158, in main
controller.main()
File "./getan.py", line 40, in main
self.view.run()
File "/home/bjoern/getan/getan/view.py", line 364, in run
self.loop.run()
File "/home/bjoern/getan/urwid/main_loop.py", line 170, in run
self.screen.run_wrapper(self._run)
File "/home/bjoern/getan/urwid/raw_display.py", line 234, in run_wrapper
return fn()
File "/home/bjoern/getan/urwid/main_loop.py", line 188, in _run
self.event_loop.run()
File "/home/bjoern/getan/urwid/main_loop.py", line 498, in run
self._loop()
File "/home/bjoern/getan/urwid/main_loop.py", line 523, in _loop
self._watch_files[fd]()
File "/home/bjoern/getan/urwid/main_loop.py", line 231, in _update
keys = self.input_filter(keys, raw)
File "/home/bjoern/getan/urwid/main_loop.py", line 337, in input_filter
return self._input_filter(keys, raw)
File "./getan.py", line 50, in input_filter
self.state = self.state.keypress(input)
File "/home/bjoern/getan/getan/states.py", line 214, in keypress
return self.enter()
File "/home/bjoern/getan/getan/states.py", line 293, in enter
self.controller.stop_project(text)
File "./getan.py", line 134, in stop_project
self.backend.insert_project_entry(project, datetime.now(), desc)
File "/home/bjoern/getan/getan/backend.py", line 124, in insert_project_entry
project.id, project.start, stop_time, desc))
sqlite3.IntegrityError: constraint failed
Message  ↓
Date: 2013-06-25 10:43
Sender: Bjoern Schilberg

Yep. Fixed. Perfect.

Date: 2013-06-24 10:04
Sender: Bjoern Ricks

The handling of invalid values should be fine with revision 294:fdd086acdf9b

Date: 2011-05-25 12:13
Sender: Bjoern Ricks

Should be fixed in 76:07394c6155e2. Björn please verifiy

No attached documents

Field Old Value Date By
ResolutionAwaiting Response2013-06-25 10:43Bjoern Schilberg
ResolutionFixed2013-06-24 10:04Bjoern Ricks
ResolutionNone2011-05-25 12:13Bjoern Ricks