Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Date.no_date() instead of None for Task.date_due #1085

Merged
merged 1 commit into from
Apr 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions GTG/core/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ def is_valid_term():
Return a tuple of (bool, Date)
"""
if recurring_term is None:
return False, None
return False, Date.no_date()

try:
# If a start date is already set,
Expand All @@ -429,7 +429,7 @@ def is_valid_term():
return True, newdate

except ValueError:
return False, None
return False, Date.no_date()

self._is_recurring = recurring

Expand Down
2 changes: 1 addition & 1 deletion GTG/gtk/browser/quick_add.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def parse(text: str) -> Dict:
'title': '',
'tags': set(),
'start': None,
'due': None,
'due': Date.no_date(),
'recurring': None
}

Expand Down
2 changes: 1 addition & 1 deletion tests/core/test_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def test_due_date(self):

# Test changing parent's due (None or nodate)
task2.date_due = random_date
task1.date_due = None
task1.date_due = Date.no_date()
self.assertEqual(task2.date_due, random_date)


Expand Down