{"action":"created","issue":{"url":"https://api.github.com/repos/systers/mentorship-backend/issues/125","repository_url":"https://api.github.com/repos/systers/mentorship-backend","labels_url":"https://api.github.com/repos/systers/mentorship-backend/issues/125/labels{/name}","comments_url":"https://api.github.com/repos/systers/mentorship-backend/issues/125/comments","events_url":"https://api.github.com/repos/systers/mentorship-backend/issues/125/events","html_url":"https://github.com/systers/mentorship-backend/pull/125","id":348942125,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA3MTc2MzQw","number":125,"title":"Added sent_by_me field to list Mentorship Relation API","user":{"login":"isabelcosta","id":11148726,"node_id":"MDQ6VXNlcjExMTQ4NzI2","avatar_url":"https://avatars1.githubusercontent.com/u/11148726?v=4","gravatar_id":"","url":"https://api.github.com/users/isabelcosta","html_url":"https://github.com/isabelcosta","followers_url":"https://api.github.com/users/isabelcosta/followers","following_url":"https://api.github.com/users/isabelcosta/following{/other_user}","gists_url":"https://api.github.com/users/isabelcosta/gists{/gist_id}","starred_url":"https://api.github.com/users/isabelcosta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isabelcosta/subscriptions","organizations_url":"https://api.github.com/users/isabelcosta/orgs","repos_url":"https://api.github.com/users/isabelcosta/repos","events_url":"https://api.github.com/users/isabelcosta/events{/privacy}","received_events_url":"https://api.github.com/users/isabelcosta/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-08-09T01:00:20Z","updated_at":"2018-08-09T04:07:37Z","closed_at":"2018-08-09T01:13:53Z","author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/systers/mentorship-backend/pulls/125","html_url":"https://github.com/systers/mentorship-backend/pull/125","diff_url":"https://github.com/systers/mentorship-backend/pull/125.diff","patch_url":"https://github.com/systers/mentorship-backend/pull/125.patch"},"body":"# Description\r\n\r\nAdded `sent_by_me` field to any MentorshipRelation API. Affected APIs include all APIs that list mentorship relations as a list or isolated, like showing the current relation.\r\n\r\nThe solution is the only hack that I could see fit.\r\nI change the model object just before being marshalled by flask restplus.\r\nI do this with `setattr()` function and I attribute the value from the conditio if the `action_user_id` is the current user's id\r\n\r\nFixes #124\r\n\r\n# Type of Change:\r\n\r\n- Code\r\n\r\n**Code/Quality Assurance Only**\r\n- Bug fix (non-breaking change which fixes an issue)\r\n\r\n\r\n# How Has This Been Tested?\r\n\r\nAdded test to see if the field `sent_by_me` value was well set\r\nTested on Swagger\r\n\r\n\r\n# Checklist:\r\n\r\n- [x] My PR follows the style guidelines of this project\r\n- [x] I have performed a self-review of my own code or materials\r\n- [x] I have commented my code or provided relevant documentation, particularly in hard-to-understand areas\r\n- [x] Update Swagger documentation and the exported file at /docs folder\r\n\r\n**Code/Quality Assurance Only**\r\n- [x] My changes generate no new warnings \r\n- [x] I have added tests that prove my fix is effective or that my feature works\r\n- [x] New and existing unit tests pass locally with my changes\r\n"},"comment":{"url":"https://api.github.com/repos/systers/mentorship-backend/issues/comments/411630381","html_url":"https://github.com/systers/mentorship-backend/pull/125#issuecomment-411630381","issue_url":"https://api.github.com/repos/systers/mentorship-backend/issues/125","id":411630381,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMTYzMDM4MQ==","user":{"login":"sys-bot","id":39593843,"node_id":"MDQ6VXNlcjM5NTkzODQz","avatar_url":"https://avatars0.githubusercontent.com/u/39593843?v=4","gravatar_id":"","url":"https://api.github.com/users/sys-bot","html_url":"https://github.com/sys-bot","followers_url":"https://api.github.com/users/sys-bot/followers","following_url":"https://api.github.com/users/sys-bot/following{/other_user}","gists_url":"https://api.github.com/users/sys-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/sys-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sys-bot/subscriptions","organizations_url":"https://api.github.com/users/sys-bot/orgs","repos_url":"https://api.github.com/users/sys-bot/repos","events_url":"https://api.github.com/users/sys-bot/events{/privacy}","received_events_url":"https://api.github.com/users/sys-bot/received_events","type":"User","site_admin":false},"created_at":"2018-08-09T04:07:37Z","updated_at":"2018-08-09T04:07:37Z","author_association":"COLLABORATOR","body":"@isabelcosta Can you try now once more?"}}
{"actor":{"display_login":"sys-bot"}}