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

feat: Show notification types with respect to user forum roles #33927

Merged
merged 1 commit into from
Jan 2, 2024

Conversation

AhtishamShahid
Copy link
Contributor

@AhtishamShahid AhtishamShahid commented Dec 14, 2023

Check forum roles in case attribute named visible_to is set on notification preference object . This type of notification preference would be visible one to user that have role that is set in configurations.

Example

from openedx.core.djangoapps.django_comment_common.models import (
    FORUM_ROLE_ADMINISTRATOR,
    FORUM_ROLE_COMMUNITY_TA,
    FORUM_ROLE_GROUP_MODERATOR,
    FORUM_ROLE_MODERATOR,
)
COURSE_NOTIFICATION_TYPES = {
...
    'new_question_post': {
        'notification_app': 'discussion',
        'name': 'new_question_post',
        'is_core': False,
        'info': '',
        'web': False,
        'email': False,
        'push': False,
        'non_editable': [],
        'content_template': _('<{p}><{strong}>{username}</{strong}> asked <{strong}>{post_title}</{strong}></{p}>'),
        'content_context': {
            'post_title': 'Post title',
            'username': 'Post author name',
        },
        'email_template': '',
        'filters': [FILTER_AUDIT_EXPIRED_USERS_WITH_NO_ROLE],
        'visible_to': [FORUM_ROLE_MODERATOR, FORUM_ROLE_COMMUNITY_TA, FORUM_ROLE_ADMINISTRATOR]

    }
...
}

@AhtishamShahid AhtishamShahid changed the title feat: Show notification types with respect to user form roles feat: Show notification types with respect to user forum roles Dec 14, 2023
@muhammadadeeltajamul muhammadadeeltajamul merged commit c2383fa into master Jan 2, 2024
64 checks passed
@muhammadadeeltajamul muhammadadeeltajamul deleted the ahtihsam/INF-945 branch January 2, 2024 10:09
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

1 similar comment
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

thezaeemaanwar added a commit to thezaeemaanwar/edx-platform that referenced this pull request Jan 3, 2024
fix: indentation issues

feat: Show notification types with respect to user form roles (openedx#33927)

feat: Upgrade Python dependency edx-enterprise

 removed course completion check from is_already_transmitted utility

Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master`

fix: Update the date to the max year possible in a test. (openedx#33994)

This test broke on January 1, 2024.

chore(i18n): update translations
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.

5 participants