diff --git a/sefaria/model/schema.py b/sefaria/model/schema.py index 5506594bb0..609c8abeba 100644 --- a/sefaria/model/schema.py +++ b/sefaria/model/schema.py @@ -588,7 +588,7 @@ def traverse_tree(self, callback, **kwargs): """ callback(self, **kwargs) for child in self.children: - child.traverse_to_string(callback, **kwargs) + child.traverse_tree(callback, **kwargs) def traverse_to_string(self, callback, depth=0, **kwargs): st = callback(self, depth, **kwargs) diff --git a/sefaria/model/topic.py b/sefaria/model/topic.py index 2304a7a5b4..a916c78c16 100644 --- a/sefaria/model/topic.py +++ b/sefaria/model/topic.py @@ -276,6 +276,9 @@ def set_slug(self, new_slug) -> None: def merge(self, other: Union['Topic', str]) -> None: """ + Merge `other` into `self`. This means that all data from `other` will be merged into self. + Data from self takes precedence in the event of conflict. + Links to `other` will be changed to point to `self` and `other` will be deleted. :param other: Topic or old slug to migrate from :return: None """ diff --git a/static/js/AdminEditor.jsx b/static/js/AdminEditor.jsx index 1d1ecea94a..a375880cb7 100644 --- a/static/js/AdminEditor.jsx +++ b/static/js/AdminEditor.jsx @@ -13,15 +13,17 @@ const options_for_form = { label: "English Description", field: "enDescription", placeholder: "Add a description.", - type: 'textarea' + type: 'textarea', + markdown: true, }, "Hebrew Description": { label: "Hebrew Description", field: "heDescription", placeholder: "Add a description.", - type: 'textarea' + type: 'textarea', + markdown: true }, - "Prompt": {label: "Prompt", field: "prompt", placeholder: "Add a prompt.", textarea: true}, + "Prompt": {label: "Prompt", field: "prompt", placeholder: "Add a prompt.", type: 'textarea'}, "English Short Description": { label: "English Short Description for Table of Contents", field: "enCategoryDescription", placeholder: "Add a short description.", type: 'input' @@ -136,7 +138,7 @@ const AdminEditor = ({title, data, close, catMenu, pictureUploader, updateData, const preprocess = async () => { setValidatingLinks(true); for (const x of items) { - if (options_for_form[x]?.is_textarea) { + if (options_for_form[x]?.markdown) { const field = options_for_form[x].field; const valid_tags = await validateMarkdownLinks(data[field]); if (!valid_tags) {