Skip to content

Commit

Permalink
Fix deprecated methods calls
Browse files Browse the repository at this point in the history
  • Loading branch information
9dogs committed Nov 6, 2021
1 parent bef6b87 commit 470b9c2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions notion_sync_addon/notes_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ def create_note(self, note: AnkiNote) -> int:
"""
# Pick right model
if not note.back:
model = self.collection.models.byName(self.CLOZE_MODEL_NAME)
model = self.collection.models.by_name(self.CLOZE_MODEL_NAME)
else:
model = self.collection.models.byName(self.MODEL_NAME)
model = self.collection.models.by_name(self.MODEL_NAME)
# Create note and add it to the deck
anki_note = Note(self.collection, model)
deck_id = self.get_deck()
Expand All @@ -217,11 +217,11 @@ def update_note(self, note_id: int, note: AnkiNote) -> bool:
updated_data = []
# Pick right model
if not note.back:
model = self.collection.models.byName(self.CLOZE_MODEL_NAME)
model = self.collection.models.by_name(self.CLOZE_MODEL_NAME)
else:
model = self.collection.models.byName(self.MODEL_NAME)
model = self.collection.models.by_name(self.MODEL_NAME)
# Get an existing note
existing_note = self.collection.getNote(note_id)
existing_note = self.collection.get_note(note_id)
# Ensure note is of right model
if existing_note.mid != model['id']:
self.logger.warning(
Expand Down

0 comments on commit 470b9c2

Please sign in to comment.