Skip to content

Commit 4ba3103

Browse files
authored
🔀 Merge pull request #28 from davep/tweak-move
Improve the interface of Subscriptions.move
2 parents 39285a2 + 2a24f30 commit 4ba3103

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

ChangeLog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# OldAS ChangeLog
22

3+
## Unreleased
4+
5+
**Released: WiP**
6+
7+
- Updated `Subscriptions.move` so that any form of "empty" for the
8+
`target_folder` is seen as a "remove folder" operation.
9+
([#28](https://github.com/davep/oldas/pull/28))
10+
311
## v0.5.0
412

513
**Released: 2026-01-24**

src/oldas/subscriptions.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,12 +272,15 @@ async def move(
272272
[`True`][True] if the move call worked, [`False`][False] if not.
273273
274274
Note:
275-
If `target_folder` is omitted, the subscription will be moved to
276-
the top-level default folder.
275+
If `target_folder` is omitted, is [`None`][None], or is an empty
276+
[string][str], the subscription will be moved to the top-level
277+
default folder.
277278
"""
279+
if isinstance(target_folder, str):
280+
target_folder = target_folder.strip()
278281
operation = (
279282
{"r": "remove"}
280-
if target_folder is None
283+
if not target_folder
281284
else {"a": Folders.full_id(target_folder)}
282285
)
283286
return await session.post_ok(

0 commit comments

Comments
 (0)