Skip to content
Open
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
8 changes: 6 additions & 2 deletions syncall/tw_caldav_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,12 @@ def convert_tw_to_caldav(tw_item: Item) -> Item:
tw_item=tw_item,
)

# Priority
if "priority" in tw_item:
# Priority - tw treats priority as a UDA, so any custom options just ignore for now
if (
"priority" in tw_item.keys()
and tw_item["priority"].lower() in aliases_tw_caldav_priority.keys()
):

caldav_item["priority"] = aliases_tw_caldav_priority[tw_item["priority"].lower()]
else:
caldav_item["priority"] = ""
Expand Down
3 changes: 2 additions & 1 deletion tests/test_tw_caldav_conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def caldav_item_with_priority(prio: int) -> dict:
tw_pending_item_with_priority(tw_prio),
caldav_item_with_priority(caldav_prio),
)
for tw_prio, caldav_prio in [("L", 9), ("M", 5), ("H", 1)]
for tw_prio, caldav_prio in [("L", 9), ("M", 5), ("H", 1), ("T", 0)]
),
],
ids=[
Expand All @@ -169,6 +169,7 @@ def caldav_item_with_priority(prio: int) -> dict:
"pending_item_with_priority_L",
"pending_item_with_priority_M",
"pending_item_with_priority_H",
"pending_item_with_priority_T",
],
)
def test_convert_tw_to_caldav_n_back(tw_item, caldav_item_expected):
Expand Down
Loading