mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Rejects field names starting with #, ^ and /
This commit is contained in:
parent
3be90c444d
commit
af6cb6612e
2 changed files with 4 additions and 0 deletions
|
@ -12,3 +12,4 @@ fields-reverse-text-direction-rtl = Reverse text direction (RTL)
|
||||||
fields-size = Size:
|
fields-size = Size:
|
||||||
fields-sort-by-this-field-in-the = Sort by this field in the browser
|
fields-sort-by-this-field-in-the = Sort by this field in the browser
|
||||||
fields-that-field-name-is-already-used = That field name is already used.
|
fields-that-field-name-is-already-used = That field name is already used.
|
||||||
|
fields-name-first-letter-not-valid = The field name should not start with #, ^ or /.
|
|
@ -85,6 +85,9 @@ class FieldDialog(QDialog):
|
||||||
txt = getOnlyText(prompt, default=old).replace('"', "").strip()
|
txt = getOnlyText(prompt, default=old).replace('"', "").strip()
|
||||||
if not txt:
|
if not txt:
|
||||||
return
|
return
|
||||||
|
if txt[0] in "#^/":
|
||||||
|
showWarning(tr(TR.FIELDS_NAME_FIRST_LETTER_NOT_VALID))
|
||||||
|
return
|
||||||
for f in self.model["flds"]:
|
for f in self.model["flds"]:
|
||||||
if ignoreOrd is not None and f["ord"] == ignoreOrd:
|
if ignoreOrd is not None and f["ord"] == ignoreOrd:
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in a new issue