Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't flush note when in add mode #80

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zjosua
Copy link
Contributor

@zjosua zjosua commented Dec 30, 2021

Description

Don't flush note when in add mode.

Caught exception:
Traceback (most recent call last):
  File "/home/zjosua/.cache/bazel/_bazel_zjosua/1c79c7ac51bf6692c8fc3f9a9a4ef48a/execroot/ankidesktop/bazel-out/k8-fastbuild/bin/qt/runanki.runfiles/ankidesktop/qt/aqt/webview.py", line 546, in handler
    cb(val)
  File "/home/zjosua/.cache/bazel/_bazel_zjosua/1c79c7ac51bf6692c8fc3f9a9a4ef48a/execroot/ankidesktop/bazel-out/k8-fastbuild/bin/qt/runanki.runfiles/ankidesktop/qt/aqt/editor.py", line 528, in <lambda>
    self.web.evalWithCallback("saveNow(%d)" % keepFocus, lambda res: callback())
  File "/home/zjosua/.local/share/Anki2/addons21/cloze_overlapper/editor.py", line 154, in <lambda>
    editor.saveNow(lambda: callback(editor, *args, **kwargs))
  File "/home/zjosua/.local/share/Anki2/addons21/cloze_overlapper/editor.py", line 283, in onOlClozeButton
    return onFieldReady()
  File "/home/zjosua/.local/share/Anki2/addons21/cloze_overlapper/editor.py", line 270, in onFieldReady
    overlapper.add()
  File "/home/zjosua/.local/share/Anki2/addons21/cloze_overlapper/overlapper.py", line 117, in add
    self.updateNote(fields, full, setopts, custom)
  File "/home/zjosua/.local/share/Anki2/addons21/cloze_overlapper/overlapper.py", line 203, in updateNote
    note.flush()
  File "/home/zjosua/.cache/bazel/_bazel_zjosua/1c79c7ac51bf6692c8fc3f9a9a4ef48a/execroot/ankidesktop/bazel-out/k8-fastbuild/bin/qt/runanki.runfiles/ankidesktop/pylib/anki/notes.py", line 81, in flush
    raise Exception("can't flush a new note")
Exception: can't flush a new note

Checklist:

  • I've read and understood the contribution guidelines
  • I've tested my changes against at least one of the following Anki builds:
    • Latest standard Anki 2.1 binary build [required for Anki-compatible 2.1 add-ons]
    • Latest Anki 2.1 dev commit (2df3698e8)
    • Latest alternative Anki 2.1 binary build
    • Latest Anki 2.0 binary build [required for Anki 2.0-compatible add-ons]
  • I've tested my changes on at least one of the following platforms:
    • Linux, version: Debian bookworm
    • Windows, version:
    • macOS, version:
  • My changes potentially affect non-desktop platforms, of which I've tested:
    • AnkiMobile, version:
    • AnkiDroid, version:
    • AnkiWeb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant