-
Notifications
You must be signed in to change notification settings - Fork 0
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
Krist/be 443 configure notifications #107
Conversation
…e-notifications # Conflicts: # tests/conftest.py
…-443-configure-notifications
…/be-443-configure-notifications
…e-notifications # Conflicts: # tests/conftest.py
…ions' into krist/be-443-configure-notifications # Conflicts: # tests/conftest.py
…r-services' into krist/be-443-configure-notifications # Conflicts: # tests/conftest.py
app.config["NOTIFICATION_RECIPIENTS_RESOLVERS"] = always_merger.merge( | ||
app_registered_event_types, config.NOTIFICATION_RECIPIENTS_RESOLVERS | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably the alwaysmerge is not a correct solution - should replace a value only if it is not already there, not always
|
||
|
||
class SpecificEntityRecipient(RecipientGenerator): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please a docstring here
class UserEmailRecipient(SpecificEntityRecipient): | ||
"""User email recipient generator for a notification.""" | ||
|
||
def __call__(self, notification: Notification, recipients: dict): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd change the methods place:
- Put call into SpecificEntityRecipient - will call the _resolve_entity method and then call self._get_recipients(entity) -> Iterator[Recipient]
- Subclasses would implement the abstract _get_recipients
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so in this case, the impl would be:
def _get_recipients(self, entity: User):
return Recipient(data={"email": entity.email})
Quality Gate passedIssues Measures |
No description provided.