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

fixes #1198 - Send mail to question's author on new answer create and test this #1321

Merged
merged 1 commit into from
Mar 9, 2017

Conversation

saurabh-sikchi
Copy link
Contributor

@saurabh-sikchi saurabh-sikchi commented Mar 7, 2017

Original Issue #1198

I have made changes to answer model's answer_notify method. Earlier, the mail was not being sent to the question's author. After this commit, the mail is being sent and the tests are passing.

Also see, pull #1237 (not by me) which implements the proposed solution but the tests fail.

Thank you.

  • all tests pass -- rake test:all
  • code is in uniquely-named feature branch, and has been rebased on top of latest master (especially if you've been asked to make additional changes)
  • pull request is descriptively named with #number reference back to original issue

@PublicLabBot
Copy link

3 Messages
📖 @khamba Thank you for your pull request! I’m here to help with some tips and recommendations. Please take a look at the list provided and help us review and accept your contribution!
📖 Your pull request is on the master branch. Please make a separate feature branch) with a descriptive name like new-blog-design while making PRs in the future.
📖 This pull request doesn’t link to a issue number. Please refer to the issue it fixes (if any) in the format: Fixes #123.

Generated by 🚫 Danger

@saurabh-sikchi
Copy link
Contributor Author

saurabh-sikchi commented Mar 7, 2017

I am new to open source contributions. I did make a new feature branch and then merged it with master. Should I re-submit the request?

@@ -26,17 +26,17 @@ def likers

def answer_notify(current_user)
# notify question author
if current_user.uid != self.author.uid
AnswerMailer.notify_question_author(self.author, self).deliver
if current_user.uid != self.node.author.uid
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I'm not sure this is correct, @ananyo2012, can you take a look? I think we do want to notify original node (question) author when an answer is posted, but not the current user (that is, the author of the answer)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Earlier, the if conditional current_user.uid != self.author.uid was always false since the current_user was always the the answer's author. I have changed that to the node's author.

I think we do want to notify original node (question) author when an answer is posted

Agreed. Line 30 sends the mail to the node's author.

Thank you very much for reviewing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this look good to me

@jywarren
Copy link
Member

jywarren commented Mar 8, 2017 via email

@ananyo2012
Copy link
Member

@khamba You didn't need to merge the feature branch with the master. Just make the PR with the feature branch. Also whenever you solve an issue it is better to include the issue no like Fixes #<issue_no> in the commit message itself. It autocloses the issue when merged.

@jywarren jywarren merged commit 671cce8 into publiclab:master Mar 9, 2017
@jywarren
Copy link
Member

jywarren commented Mar 9, 2017

Merged, thank you! Please consider picking another issue from our help wanted listings! Thanks!!!!!

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.

4 participants