Commit cf7892f5 authored by Daniel Garcia Moreno's avatar Daniel Garcia Moreno

Merge branch 'fix_zero_seconds' into 'master'

main_window.py: Don't save activity with 0 secs

See merge request !7
parents 031fe2f9 e0be280f
Pipeline #57076 passed with stage
in 41 seconds
......@@ -361,12 +361,16 @@ class MainWindow(Gtk.ApplicationWindow):
name = self.activity_label.get_text()
start = self.start_date
stop = datetime.now()
activity = Activity(id=self.activity_id, name=name,
start=start, stop=stop, comments=self.comments)
self.application.db.set_stop(self.activity_id, stop, activity.seconds)
if (stop - start).seconds > 0:
activity = Activity(id=self.activity_id, name=name, start=start,
stop=stop, comments=self.comments)
self.application.db.set_stop(self.activity_id, stop,
activity.seconds)
self.insert_activity(activity)
self.insert_activity(activity)
self.comments = ""
self.start_date = None
self.activity_id = None
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment