mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 09:16:38 -04:00
Fix CI issues
This commit is contained in:
parent
3716ae03ca
commit
e94e811863
2 changed files with 13 additions and 9 deletions
|
@ -32,12 +32,13 @@ def remove_decks(
|
|||
def reparent_decks(
|
||||
*, parent: QWidget, deck_ids: Sequence[DeckId], new_parent: DeckId
|
||||
) -> CollectionOp[OpChangesWithCount]:
|
||||
def on_success(out):
|
||||
if out.count > 0:
|
||||
tooltip(tr.browsing_reparented_decks(count=out.count), parent=parent)
|
||||
|
||||
return CollectionOp(
|
||||
parent, lambda col: col.decks.reparent(deck_ids=deck_ids, new_parent=new_parent)
|
||||
).success(
|
||||
lambda out: out.count > 0
|
||||
and tooltip(tr.browsing_reparented_decks(count=out.count), parent=parent)
|
||||
)
|
||||
).success(on_success)
|
||||
|
||||
|
||||
def rename_deck(
|
||||
|
|
|
@ -36,14 +36,17 @@ impl Collection {
|
|||
for deck in deck_ids {
|
||||
if let Some(mut deck) = self.storage.get_deck(*deck)? {
|
||||
if let Some(new_name) = deck.name.reparented_name(target_name.as_ref()) {
|
||||
|
||||
let parent_decks = self.storage.parent_decks(&deck).unwrap();
|
||||
match target_deck {
|
||||
Some(ref target) => if parent_decks.contains(&target) {
|
||||
continue;
|
||||
Some(ref target) => {
|
||||
if parent_decks.contains(target) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
None => if parent_decks.is_empty() {
|
||||
continue;
|
||||
None => {
|
||||
if parent_decks.is_empty() {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue