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

fix: update discussions blackout dates logic to use discussions confi… #32896

Merged
merged 2 commits into from
Aug 4, 2023

Conversation

AhtishamShahid
Copy link
Contributor

@AhtishamShahid AhtishamShahid commented Aug 2, 2023

Ticket

https://2u-internal.atlassian.net/browse/INF-994

Description

Use posting_restrictions field from DiscussionsConfiguration mode in the decision for allowing posting in forum, previously only dates were used, which was inconsistent with the use case.

Copy link
Contributor

@saadyousafarbi saadyousafarbi left a comment

Choose a reason for hiding this comment

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

Just some nits, the rest looks good!


Arguments:
course: Course to check discussions for
user: User to check for privileges in course
"""
return course.forum_posts_allowed or has_discussion_privileges(user, course.id)
discussions_config = DiscussionsConfiguration.get(course.id).posting_restrictions
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we rename this to something more specific. Like discussions_posting_restrictions

self.course.get_discussion_blackout_datetimes()
)

def test_posting_disabled(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use ddt to group these tests together?

@AhtishamShahid AhtishamShahid merged commit 7e23fee into master Aug 4, 2023
42 checks passed
@AhtishamShahid AhtishamShahid deleted the ahtisham/INF-994 branch August 4, 2023 13:02
@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.

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