Forums

API: pause task not working

I'm trying to pause a task using PythonAnywhere API, however I cannot put/patch the 'enabled' field, while it let me change the others. Am I doing something wrong or it is the API's fault?

My pause function

The task that you're trying to pause does not exist, so that request is trying to create a task. If you want to pause a task, you need to pause a task that exists.

Thanks for the quick response. I'm trying to modify an existing task, in fact that's the response I get when I change the field:

Using field: 'description'

It actually updated the task, as I can see visiting the task url:

proof

If you look at the 2 ids of the tasks you're accessing, you can see that the first and the second differ and the second one succeeded because the second one is the tasks that exists.

I used a different task for the reply, but I can ensure that both exist (Their urls come from a function that gets all existing tasks), but I'll queue the two functions to show you the output.

When I queue the two functions

As you can see it works when I change the 'description' field, while it doesn't when I do the same with the 'enabled' one.

OK. This looks like something that we may need to look in to.

Ok, thank you for your support!