Skip to content

Commit

Permalink
doesn't add empty CATEGORIES if field empty in interactive mode
Browse files Browse the repository at this point in the history
  • Loading branch information
titibandit committed Oct 18, 2023
1 parent 9013750 commit ab0bdcc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion khal/khalendar/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,9 @@ def categories(self) -> str:

def update_categories(self, categories: List[str]) -> None:
assert isinstance(categories, list)
categories = [c.strip().lower() for c in categories if c != ""]
self._vevents[self.ref].pop('CATEGORIES', False)
if categories:
if len(categories) > 0:
self._vevents[self.ref].add('CATEGORIES', categories)

@property
Expand Down

0 comments on commit ab0bdcc

Please sign in to comment.