Skip to content

Commit

Permalink
ui:Set default value to timedelta arg in add_alarm()
Browse files Browse the repository at this point in the history
Fixes pimutils#1338: Adding an alarm in ikhal causes a crash

> When adding an alarm in ikhal to an existing or new event the program
crashes.

> `TypeError: AlarmsEditor.add_alarm() missing 1 required positional argument: 'timedelta'`
  • Loading branch information
Paul Riou committed Jan 17, 2025
1 parent a0e3fd1 commit 8ecca1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion khal/ui/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ def clear(self) -> None:
"""clear the alarm list"""
self.pile.contents.clear()

def add_alarm(self, button, timedelta: Optional[dt.timedelta]):
def add_alarm(self, button, timedelta: Optional[dt.timedelta] = None):
if timedelta is None:
timedelta = dt.timedelta(0)
self.pile.contents.insert(
Expand Down

0 comments on commit 8ecca1c

Please sign in to comment.