Skip to content
This repository has been archived by the owner on Dec 31, 2023. It is now read-only.

modelTemplateRename always responds with "unsupported action" #408

Open
jojo259 opened this issue Oct 13, 2023 · 0 comments
Open

modelTemplateRename always responds with "unsupported action" #408

jojo259 opened this issue Oct 13, 2023 · 0 comments

Comments

@jojo259
Copy link

jojo259 commented Oct 13, 2023

Seems to also apply to modelTemplateAdd and modelTemplateRename (potentially others too).

import requests

response = requests.post('http://localhost:8765', json = {
	'action': 'modelTemplateRename',
	'version': 6,
	'params': {
		'modelName': 'Basic',
		'oldTemplateName': 'Card 1',
		'newTemplateName': 'Card 1 renamed'
	}
})

print(response.text)
curl -X POST -H "Content-Type: application/json" -d "{\"action\": \"modelTemplateRename\", \"version\": 6, \"params\": {\"modelName\": \"Basic\", \"oldTemplateName\": \"Card 1\", \"newTemplateName\": \"Card 1 renamed\"}}" http://localhost:8765

Always results in {"result": null, "error": "unsupported action"} no matter which versions, model names, or template names I use and the same applies to the other two actions.

Line of code with that string: https://github.com/FooSoft/anki-connect/blob/master/plugin/__init__.py#L128

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

No branches or pull requests

1 participant