Learn more about these different git repos.
Other Git URLs
No commits found
Fixes: #793
rebased onto de97ef30539cc73d64d99d80c48b3dbcab4a3351
why this if condition? Just use send_mail([user.mail]), unless you really expect that user.mail variable can hold array value.
send_mail([user.mail])
user.mail
rebased onto 9d771f85357e1a801702fbeff9f6e8e43144a7e5
1 new commit added
Adding test for function filter_recipients
nitpick, don't you want to s/recepient/recepients/? And fix the comment to "List of recepient emails" or something?
The trailing comma can be probably removed here.
I'd simply do:
if not app.config["WHITELIST_EMAILS"]: return recepients
Because if the config option is empty (production), it is useless to iterate over all the recipients.
and you can do return [r for r in recepients if r in app.config["WHITELIST_EMAILS"]]
return [r for r in recepients if r in app.config["WHITELIST_EMAILS"]]
rebased onto 95def9224952b2e2cdafa03ca3085fbf2026e9cf
+1
Ansible patch applied here: https://infrastructure.fedoraproject.org/cgit/ansible.git/commit/?id=29ce5dfd26e3eec90ba858adf6904f9a6952890f
Personally, I would preserve the same input types for send_mail function (i.e. both one email or list of emails) and therefore omitting this and many similar changes like this one that are lower in this PR.
send_mail
It was added in the same commit as the whitelisting feature, but it is not necessary for that feature, so I am interested in the idea behind it :-)
Aha, that was probably related to this, right?
@praiskup do you prefer it this way?
Yeah, I sort of disliked doing if type(recepient) on multiple places. No huge preference, it was rather suggestion since I think that stronger typing is usually better.
nitpick: I would prefer a slightly longer, but more descriptive function name, e.g. filter_whitelisted_recipients. This is IMHO too generic and when reading its name, I have no idea why/what would I even filter.
filter_whitelisted_recipients
I believed that we removed this multiple-types-for-one-arguments from send_mail, if we did not - we should IMO
nitpick: I am absolutely aware of how unimportant this is for the majority of people, and how annoying I am for always pointing that out, but can you please move the condition above the with statement, reverse it to if not ... and return if it is met? This will avoid unnecessary nesting and make me happy. Also, it would be a good idea to log some message, that the email will not be sent because there is no whitelisted recipient.
with
if not ...
return
Ok, no problem with me. Let's accept just list of email addresses. I was just a little bit confused because it was in the same commit as the feature and they are not related to each other.
Ok, I think we should have these two commits squashed.
rebased onto 78be9b966b6513c9eb33a4ed7d1a109838e7bd0f
rebased onto 05e170c8399b4ecfe13250686bd2221dd95f88bf
rebased onto 81f2925
+1, thank you
Commit 51e452a fixes this pull-request
Pull-Request has been merged by praiskup
Fixes: #793