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

Support configuration from bucket metadata (fixes #27) #28

Merged
merged 2 commits into from
Jan 30, 2017

Conversation

leplatrem
Copy link
Contributor

Fixes #27

@leplatrem leplatrem requested a review from Natim January 27, 2017 15:11
@leplatrem leplatrem mentioned this pull request Jan 27, 2017
3 tasks
metadata = storage.get(parent_id=bucket_uri,
collection_id='collection',
object_id=collection_id)
if 'kinto-emailer' not in metadata:
Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member

@Natim Natim left a comment

Choose a reason for hiding this comment

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

👍

emails = [r for r in recipients if not GROUP_REGEXP.match(r)]
groups = [r for r in recipients if GROUP_REGEXP.match(r)]
groups = [r.format(**context) for r in recipients
Copy link
Member

Choose a reason for hiding this comment

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

I think it worth having a comment saying that you might want to build the group name from the collection_id

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added it in the merge commit

@@ -161,7 +170,7 @@ def includeme(config):

# Listen to collection modification before commit for validation.
config.add_subscriber(_validate_emailer_settings, ResourceChanged,
for_resources=('collection',),
for_resources=('bucket', 'collection',),
for_actions=('create', 'update'))

# Listen to collection and record change events.
Copy link
Member

Choose a reason for hiding this comment

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

I guess we should probably support groups and buckets events for email notifications.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created #31

@leplatrem leplatrem merged commit 1f55d62 into master Jan 30, 2017
@leplatrem leplatrem deleted the 27-configuration-on-buckets branch January 30, 2017 09:52
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