Skip to content

Commit

Permalink
notification: remove none evaluation from email
Browse files Browse the repository at this point in the history
  • Loading branch information
kpsherva committed Jul 21, 2023
1 parent d8d398e commit d85f8cc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{% set request_id = invitation_request.id %}

{% set community_title = community.metadata.title %}
{% set message = notification.context.message | safe %}
{% set message = notification.context.message | safe if message else '' %}
{% set role = notification.context.role %}

{# TODO: use request.links.self_html when issue issue is resolved: https://github.com/inveniosoftware/invenio-rdm-records/issues/1327 #}
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
from invenio_records_resources.references.entity_resolvers import ServiceResultResolver
from invenio_records_resources.services.custom_fields import TextCF
from invenio_requests.proxies import current_events_service, current_requests_service
from invenio_users_resources.proxies import current_users_service
from invenio_users_resources.records import UserAggregate
from invenio_users_resources.services.schemas import (
NotificationPreferences,
UserPreferencesSchema,
UserSchema,
)
from invenio_users_resources.proxies import current_users_service
from invenio_vocabularies.proxies import current_service as vocabulary_service
from invenio_vocabularies.records.api import Vocabulary
from marshmallow import fields
Expand Down
4 changes: 3 additions & 1 deletion tests/members/test_members_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -1217,5 +1217,7 @@ def test_community_invitation_notification(
assert "/me/requests/{}".format(inv["request"]["id"]) in html
# role titles will be capitalized
assert role.capitalize() in html
assert message in html
# TODO message was showing None in the email see fix in community-invitation.submit.jinja:7
# assert message in html
assert "You have been invited to join" in html
assert community._record.metadata["title"] in html

0 comments on commit d85f8cc

Please sign in to comment.