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

Create Deal Error #1

Open
jonch070 opened this issue Oct 6, 2024 · 5 comments
Open

Create Deal Error #1

jonch070 opened this issue Oct 6, 2024 · 5 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@jonch070
Copy link

jonch070 commented Oct 6, 2024

Hello! I get the following error when trying to create a deal after hitting enter after adding deal name

🖇️ https://app-eu1.hubspot.com/contacts/45891555/record/0-2/23610107723
🖇️ https://app-eu1.hubspot.com/contacts/45891555/record/0-1/65177433719
Traceback (most recent call last):
  File "/Users/jonathankawchuk/hubspot-tui/tui.py", line 170, in <module>
    tui.launch_menu()
  File "/Users/jonathankawchuk/hubspot-tui/tui.py", line 139, in launch_menu
    self.create_deal()
  File "/Users/jonathankawchuk/hubspot-tui/tui.py", line 60, in create_deal
    deal_stage = self.get_stage()
  File "/Users/jonathankawchuk/hubspot-tui/tui.py", line 128, in get_stage
    stages = [ f'{s.get("stage_id")} - {s.get("label")}' for s in self.hs_client.get_pipeline().get("stages")]
  File "/Users/jonathankawchuk/hubspot-tui/hubspot_client.py", line 97, in get_pipeline
    data = response.json().get("results")[2]
IndexError: list index out of range
@Ben8t
Copy link
Owner

Ben8t commented Oct 27, 2024

Hello @jonch070, can you try by replacing data = response.json().get("results")[2]by data = response.json().get("results")[1]in line 97 of hubspot_client.py ?

Probably something hardcoded on my side to fit with my HS account...

@Ben8t Ben8t added bug Something isn't working good first issue Good for newcomers labels Oct 27, 2024
@jonch070
Copy link
Author

jonch070 commented Nov 3, 2024

thanks thanks! Changed that line, getting this error again at the same point

🖇️ https://app-eu1.hubspot.com/contacts/45891555/record/0-2/23598200927
🖇️ https://app-eu1.hubspot.com/contacts/45891555/record/0-1/65177989149
Traceback (most recent call last):
  File "/Users/jonathankawchuk/hubspot-tui/tui.py", line 170, in <module>
    tui.launch_menu()
  File "/Users/jonathankawchuk/hubspot-tui/tui.py", line 139, in launch_menu
    self.create_deal()
  File "/Users/jonathankawchuk/hubspot-tui/tui.py", line 60, in create_deal
    deal_stage = self.get_stage()
  File "/Users/jonathankawchuk/hubspot-tui/tui.py", line 128, in get_stage
    stages = [ f'{s.get("stage_id")} - {s.get("label")}' for s in self.hs_client.get_pipeline().get("stages")]
  File "/Users/jonathankawchuk/hubspot-tui/hubspot_client.py", line 97, in get_pipeline
    data = response.json().get("results")[1]
IndexError: list index out of range

@jonch070 jonch070 closed this as completed Nov 3, 2024
@jonch070 jonch070 reopened this Nov 3, 2024
@Ben8t
Copy link
Owner

Ben8t commented Nov 17, 2024

Ok was a guess... I'm not really using the CLI at the moment and don't really have time to dig into this one right now :/

So you would better deep dive into yourself, PR welcome 😉 It's probably a matter of checking what's the response.json() gives back as response and change the array subset accordingly (response.json().get("results")[1])

@Ben8t
Copy link
Owner

Ben8t commented Nov 17, 2024

@jonch070 out of curiosity, what's your role and why do you choose to use this CLI?

When I created this piece of code, I was initially thinking it will be only a niche thing that nobody would actually use 😅 but I'm very curious to see you have a need too here. Can you tell me a bit more about your backstory? Also, how did you know about this repository?

@jonch070
Copy link
Author

jonch070 commented Nov 18, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants