Skip to content

Fix PR attributes handling #1048

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

Closed
wants to merge 1 commit into from

Conversation

joao-p-marques
Copy link

body_html and body_text attributes in PRs were removed. Only body exists now

@Tecnativa
TT21199

body_html and body_text attributes in PRs were removed. Only body exists now

TT21199
@sigmavirus24
Copy link
Owner

This appears to be completely incorrect based on very minimal testing:

>>> r = gh.repository('sigmavirus24', 'github3.py')
>>> pr = next(r.pull_requests())
>>> pr
<Short Pull Request [#1048]>

>>> short_pr = pr
>>> pr = short_pr.refresh()
>>> pr
<Pull Request [#1048]>

>>> pr.body
'`body_html` and `body_text` attributes in PRs were removed. Only `body` exists now\r\n\r\n@Tecnativa\r\nTT21199'

>>> pr.body_html
'<p><code>body_html</code> and <code>body_text</code> attributes in PRs were removed. Only <code>body</code> exists now</p>\n<p><a class="user-mention" data-hovercard-type="organization" data-hovercard-url="/orgs/Tecnativa/hovercard" href="https://github.com/Tecnativa">@Tecnativa</a><br>\nTT21199</p>'

>>> pr.body_text
'body_html and body_text attributes in PRs were removed. Only body exists now\n@Tecnativa\nTT21199'

>>>

This library uses the full media type in https://docs.github.com/en/rest/reference/pulls#custom-media-types-for-pull-requests which sends all 3 attributes

@joao-p-marques
Copy link
Author

@sigmavirus24 Ok, sorry, I ran into this error but it was indeed a problem between the chair and the keyboard 😅

Thanks for pointing to the correct media type, that solved the issue!

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