|
|
|
Created:
13 years, 2 months ago by rmistry Modified:
13 years, 2 months ago CC:
bsalomon, skiabot_google.com Visibility:
Public. |
DescriptionDo not send chat notifications to the original requester.
Created to fix https://code.google.com/p/rietveld/issues/detail?id=401 :
Chat sends notifications for my own rietveld interactions.
Changes staged here: https://skia-codereview-staging.appspot.com/10001/
Patch Set 1 #Patch Set 2 : Minor fix #
Total comments: 4
Patch Set 3 : Addressing codereview comments #
Total comments: 2
Patch Set 4 : Converting emails to set #
Total comments: 6
Patch Set 5 : Addressing comments #MessagesTotal messages: 14
https://codereview.appspot.com/8099046/diff/2001/codereview/views.py File codereview/views.py (right): https://codereview.appspot.com/8099046/diff/2001/codereview/views.py#newcode697 codereview/views.py:697: # context. There is no further context - a reference is enough, -1 line. =) https://codereview.appspot.com/8099046/diff/2001/codereview/views.py#newcode698 codereview/views.py:698: emails = filter(lambda email: email != request.user.email(), emails) [e for e in emails if e != request.user.email()] ?
Sign in to reply to this message.
https://codereview.appspot.com/8099046/diff/2001/codereview/views.py File codereview/views.py (right): https://codereview.appspot.com/8099046/diff/2001/codereview/views.py#newcode697 codereview/views.py:697: # context. On 2013/03/28 22:24:46, techtonik wrote: > There is no further context - a reference is enough, -1 line. =) Done :) https://codereview.appspot.com/8099046/diff/2001/codereview/views.py#newcode698 codereview/views.py:698: emails = filter(lambda email: email != request.user.email(), emails) On 2013/03/28 22:24:46, techtonik wrote: > [e for e in emails if e != request.user.email()] ? Done.
Sign in to reply to this message.
LGTM. I've checked the demo - it's good. Nothing blocking - I can commit it right away, but could you also check if works with sets? https://codereview.appspot.com/8099046/diff/7001/codereview/views.py File codereview/views.py (right): https://codereview.appspot.com/8099046/diff/7001/codereview/views.py#newcode689 codereview/views.py:689: emails = [issue.owner.email()] How do you think - is it a good idea to make emails a set? emails = set() emails.add(issue.owner.email())
Sign in to reply to this message.
https://codereview.appspot.com/8099046/diff/7001/codereview/views.py File codereview/views.py (right): https://codereview.appspot.com/8099046/diff/7001/codereview/views.py#newcode689 codereview/views.py:689: emails = [issue.owner.email()] On 2013/03/29 14:04:44, techtonik wrote: > How do you think - is it a good idea to make emails a set? > > emails = set() > emails.add(issue.owner.email()) I think thats a good idea and it seems to work. Done. Changes hosted here: https://skia-codereview-staging.appspot.com/10001/
Sign in to reply to this message.
More comments below. =) https://codereview.appspot.com/8099046/diff/12001/codereview/views.py File codereview/views.py (right): https://codereview.appspot.com/8099046/diff/12001/codereview/views.py#newcode689 codereview/views.py:689: emails = set(issue.owner.email()) The tricky part here is to be sure that email is not a string: >>> set('email@example.com') set(['a', '@', 'c', 'e', 'i', 'm', 'l', 'o', '.', 'p', 'x']) https://codereview.appspot.com/8099046/diff/12001/codereview/views.py#newcode691 codereview/views.py:691: emails = emails.union(issue.reviewers) email.update(issue.reviewers) ? http://docs.python.org/2/library/stdtypes.html#set https://codereview.appspot.com/8099046/diff/12001/codereview/views.py#newcode697 codereview/views.py:697: emails.remove(request.user.email()) emails.discard() will also remove one condition from the if clause.
Sign in to reply to this message.
https://codereview.appspot.com/8099046/diff/12001/codereview/views.py File codereview/views.py (right): https://codereview.appspot.com/8099046/diff/12001/codereview/views.py#newcode689 codereview/views.py:689: emails = set(issue.owner.email()) On 2013/03/29 14:57:09, techtonik wrote: > The tricky part here is to be sure that email is not a string: > > >>> set('email@example.com') > set(['a', '@', 'c', 'e', 'i', 'm', 'l', 'o', '.', 'p', 'x']) Looks like issue.owner.email() is always a string, not sure why my previous experiment seemed to work. I now tested it with logging. Done. https://codereview.appspot.com/8099046/diff/12001/codereview/views.py#newcode691 codereview/views.py:691: emails = emails.union(issue.reviewers) On 2013/03/29 14:57:09, techtonik wrote: > email.update(issue.reviewers) ? > > http://docs.python.org/2/library/stdtypes.html#set Done. https://codereview.appspot.com/8099046/diff/12001/codereview/views.py#newcode697 codereview/views.py:697: emails.remove(request.user.email()) On 2013/03/29 14:57:09, techtonik wrote: > emails.discard() will also remove one condition from the if clause. Done.
Sign in to reply to this message.
Perfect. I have to leave now. Need a working station to commit it, which will unlikely to happen before tomorrow if nobody else steps up.
Sign in to reply to this message.
LGTM.
Sign in to reply to this message.
Committed as https://code.google.com/p/rietveld/source/detail?r=9d5c30b9d19f53754e67933216... and live. ;)
Sign in to reply to this message.
Message was sent while issue was closed.
On 2013/03/30 10:04:22, techtonik wrote: > Committed as > https://code.google.com/p/rietveld/source/detail?r=9d5c30b9d19f53754e67933216... > and live. ;) Thank you! Marc-Antoine can we commit this into the chromium branch and push as well?
Sign in to reply to this message.
Oops. Hit the wrong form to write the comment. Now the description is lost. =/
Sign in to reply to this message.
On 2013/04/01 12:28:28, techtonik wrote: > Oops. Hit the wrong form to write the comment. Now the description is lost. =/ Fixed it.
Sign in to reply to this message.
Message was sent while issue was closed.
On 2013/04/01 12:29:27, rmistry wrote: > On 2013/04/01 12:28:28, techtonik wrote: > > Oops. Hit the wrong form to write the comment. Now the description is lost. =/ > > Fixed it. Marc-Antoine pushed this to codereview.chromium.org as well. Thanks!
Sign in to reply to this message.
|
