Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parent name to sub task #38

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

jVallant
Copy link

Example:
Before:
before
After:
after

label no_parent doesn't add name from parent
label no_sub_parent doesn't add name from this task to children

jVallant added 3 commits June 14, 2023 17:22
Example:
    Before:

        Parent Task
            Child Task
                Sub Child Task

    After:

        Parent Task
            Child Task | Parent Task
                Sub Child Task | Child Task | Parent Task

label no_parent doesn't add name from parent
label no_sub_parent doesn't add name from this task to children
@erauner12
Copy link

I like it!

@erauner12
Copy link

I'm having trouble getting this to run 😕

2023-07-21 13:24:37 2023-07-21 18:24:37 INFO     You are running with the following functionalities:
2023-07-21 13:24:37 
2023-07-21 13:24:37    Next action labelling mode: Enabled
2023-07-21 13:24:37    Regenerate sub-tasks mode: Disabled
2023-07-21 13:24:37    Shifted end-of-day mode: Disabled
2023-07-21 13:24:37    Add parent mode: Enabled
2023-07-21 13:24:37 
2023-07-21 13:24:38 2023-07-21 18:24:38 INFO     Autodoist has successfully connected to Todoist!
2023-07-21 13:24:38 2023-07-21 18:24:38 INFO     SQLite DB has successfully initialized! 
2023-07-21 13:24:38 
2023-07-21 13:24:39 2023-07-21 18:24:39 ERROR    Error trying to sync with Todoist API: 400 Client Error: Bad Request for url: https://api.todoist.com/sync/v9/sync
2023-07-21 13:24:39 Traceback (most recent call last):
2023-07-21 13:24:39   File "/usr/src/app/./autodoist.py", line 550, in sync
2023-07-21 13:24:39     response.raise_for_status()
2023-07-21 13:24:39   File "/usr/local/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status
2023-07-21 13:24:39     raise HTTPError(http_error_msg, response=self)
2023-07-21 13:24:39 requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api.todoist.com/sync/v9/sync
2023-07-21 13:24:40 2023-07-21 18:24:40 INFO     You are running with the following functionalities:
  • I see that it is enabled? Add parent mode: Enabled
  • But the container just keeps on failing upon start with 400 errors?

my docker compose command looks like this:

command: ["-l", "next_action", "-r", "1", "-hf", "0", "-a", "<redacted>", "-ap", "|"]
  • I have also tried removing the "-ap" and it's value and it seems to work just fine on your branch.

Do you happen to see where I have made a mistake @jVallant ?

@jVallant
Copy link
Author

@erauner12
I don't run it in a container. And I use the following command:
autodoist.py -a [[[[API KEY]]]] -e 3 -l next_action -d 15 -ap '|'

all your arguments seem to work fine for me, I have run them like this:
autodoist.py -a [[[[API KEY]]]] -l next_action -r 1 -hf 0 -ap '|'

This seems to be an issue only in a container.
I suspect the problem is, as I got "bad request errors" for no seemingly no reason in the development, the line 496:
https://github.com/jVallant/autodoist/blob/c83ff59ed5edb681241c5bce80f3a48f1c8ba723/autodoist.py#L496C7-L496C7

Originally it was basically a copy of the function above, but for some reason I had to remove the quote( ) around the content to get it to function without an error. It is the only part of my code (if I remember correctly) which access the API. Tough since I don't use containers I can't tell for sure.

@erauner12
Copy link

I was able to get it to work! I actually had to comb through all of my tasks and remove all hyperlinks from the subtask text. After doing this, I ran it with the same parameters and it worked.

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

Successfully merging this pull request may close these issues.

2 participants