mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Fix Mnemosyne fact ID in error messages (#4266)
This commit is contained in:
parent
a3b3b0850d
commit
1660a22548
1 changed files with 2 additions and 2 deletions
|
@ -176,7 +176,7 @@ class MnemoFact:
|
|||
try:
|
||||
fact_view = self.cards[0].fact_view_id
|
||||
except IndexError as err:
|
||||
raise Exception(f"Fact {id} has no cards") from err
|
||||
raise Exception(f"Fact {self.id} has no cards") from err
|
||||
|
||||
if fact_view.startswith("1.") or fact_view.startswith("1::"):
|
||||
return FrontOnly
|
||||
|
@ -187,7 +187,7 @@ class MnemoFact:
|
|||
elif fact_view.startswith("5.1"):
|
||||
return Cloze
|
||||
|
||||
raise Exception(f"Fact {id} has unknown fact view: {fact_view}")
|
||||
raise Exception(f"Fact {self.id} has unknown fact view: {fact_view}")
|
||||
|
||||
def anki_fields(self, fact_view: type[MnemoFactView]) -> list[str]:
|
||||
return [munge_field(self.fields.get(k, "")) for k in fact_view.field_keys]
|
||||
|
|
Loading…
Reference in a new issue