GTG

Merge lp:~izidor/gtg/bug1018805 into lp:~gtg/gtg/old-trunk

Proposed by Izidor Matušov
Status: Merged
Merged at revision: 1199
Proposed branch: lp:~izidor/gtg/bug1018805
Merge into: lp:~gtg/gtg/old-trunk
Diff against target: 32 lines (+14/-4)
1 file modified
GTG/gtk/editor/editor.py (+14/-4)
To merge this branch: bzr merge lp:~izidor/gtg/bug1018805
Reviewer Review Type Date Requested Status
Lionel Dricot (community) Approve
Bertrand Rousseau (community) code Approve
Review via email: mp+112898@code.launchpad.net

Description of the change

Fix for bug #1018805: Crash when entering invalid date

My solution solves the bug. There is also side effect (which was already there before the fix):
 1, Create invalid dates in both fields, e.g "fjasdlfjalsd", "fjasdljfalsd"
 2, Select calendar in start date and choose a date
 3, Start date is updated *and* due date is cleared instead of preserving the invalid date.

Is it acceptable behavior for GTG?

To post a comment you must log in.
Revision history for this message
Bertrand Rousseau (bertrand-rousseau) wrote :

It's ok for me, no need to nitpick for trashing an invalid date.

review: Approve (code)
Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'GTG/gtk/editor/editor.py'
--- GTG/gtk/editor/editor.py 2012-05-20 18:14:23 +0000
+++ GTG/gtk/editor/editor.py 2012-06-30 11:58:19 +0000
@@ -265,14 +265,24 @@
265265
266 #refreshing the start date field266 #refreshing the start date field
267 startdate = self.task.get_start_date()267 startdate = self.task.get_start_date()
268 prevdate = Date.parse(self.startdate_widget.get_text())268 try:
269 if startdate != prevdate:269 prevdate = Date.parse(self.startdate_widget.get_text())
270 update_date = startdate != prevdate
271 except ValueError:
272 update_date = True
273
274 if update_date:
270 self.startdate_widget.set_text(str(startdate)) 275 self.startdate_widget.set_text(str(startdate))
271276
272 #refreshing the due date field277 #refreshing the due date field
273 duedate = self.task.get_due_date()278 duedate = self.task.get_due_date()
274 prevdate = Date.parse(self.duedate_widget.get_text())279 try:
275 if duedate != prevdate:280 prevdate = Date.parse(self.duedate_widget.get_text())
281 update_date = duedate != prevdate
282 except ValueError:
283 update_date = True
284
285 if update_date:
276 self.duedate_widget.set_text(str(duedate))286 self.duedate_widget.set_text(str(duedate))
277287
278 # refreshing the closed date field288 # refreshing the closed date field

Subscribers

People subscribed via source and target branches

to status/vote changes: