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

Integrations -> Utils -> get_request - cover response 204 => "204 No Content" #26652

Closed
tonspar opened this issue Jun 3, 2024 · 3 comments · Fixed by #26656
Closed

Integrations -> Utils -> get_request - cover response 204 => "204 No Content" #26652

tonspar opened this issue Jun 3, 2024 · 3 comments · Fixed by #26656

Comments

@tonspar
Copy link
Contributor

tonspar commented Jun 3, 2024

Hello @akhilnarang,
because you have last edited file: frappe/integrations/utils.py, so I am kindly asking you for review.
I have a problem with responses w/o content. For example 204 is returned if "DELETE" request is call.

Now I have this error:

Traceback with variables (most recent call last):
  File "apps/frappe/frappe/integrations/utils.py", line 27, in make_request
    elif content_type.startswith("application/") and content_type.split(";")[0].endswith("json"):
      method = 'DELETE'
      url = 'https://graph.microsoft.com/v1.0/me/events/AQMkADY0YTc2OWMxLWJkZjgtNGI4NC1h...'
      auth = ''
      headers = {'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJub25jZSI6IkQUFBd...
      data = {}
      json = None
      params = None
      s = <requests.sessions.Session object at 0x7f4efa8f3cd0>
      response = <Response [204]>
      content_type = None
      exc = AttributeError("'NoneType' object has no attribute 'startswith'")
builtins.AttributeError: 'NoneType' object has no attribute 'startswith'

How about firstly check the the status_code like this:

Screenshot from 2024-06-03 11-36-53

Thanks for you help.

Jiri Sir

@tonspar
Copy link
Contributor Author

tonspar commented Jun 4, 2024

Thank you @akhilnarang

@frappe-pr-bot
Copy link
Collaborator

🎉 This issue has been resolved in version 15.29.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@frappe-pr-bot
Copy link
Collaborator

🎉 This issue has been resolved in version 14.76.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants