Skip to content

Commit

Permalink
refactor: move flag to a different shared module
Browse files Browse the repository at this point in the history
  • Loading branch information
mariajgrimaldi committed Jan 22, 2024
1 parent d13e6d7 commit 829315e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion cms/djangoapps/models/settings/course_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from common.djangoapps.xblock_django.models import XBlockStudioConfigurationFlag
from openedx.core.djangoapps.course_apps.toggles import exams_ida_enabled
from openedx.core.djangoapps.course_groups.partition_generator import MINIMUM_DYNAMIC_TEAM_PARTITION_ID
from openedx.core.djangoapps.course_groups.partition_scheme import CONTENT_GROUPS_FOR_TEAMS
from openedx.core.djangoapps.course_groups.flags import CONTENT_GROUPS_FOR_TEAMS
from openedx.core.djangoapps.discussions.config.waffle_utils import legacy_discussion_experience_enabled
from openedx.core.lib.teams_config import TeamsetType
from openedx.features.course_experience import COURSE_ENABLE_UNENROLLED_ACCESS_FLAG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from openedx.core import types
from openedx.core.djangoapps.content.learning_sequences.api.processors.base import OutlineProcessor
from openedx.core.djangoapps.course_groups.partition_generator import create_team_set_partition_with_course_id
from openedx.core.djangoapps.course_groups.partition_scheme import CONTENT_GROUPS_FOR_TEAMS
from openedx.core.djangoapps.course_groups.flags import CONTENT_GROUPS_FOR_TEAMS
from xmodule.partitions.partitions import Group
from xmodule.partitions.partitions_service import get_user_partition_groups

Expand Down
14 changes: 14 additions & 0 deletions openedx/core/djangoapps/course_groups/flags.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""Flags for the course_groups app."""
from openedx.core.djangoapps.waffle_utils import CourseWaffleFlag

COURSE_GROUPS_NAMESPACE = "course_groups"

# .. toggle_name: course_groups.content_groups_for_teams
# .. toggle_implementation: CourseWaffleFlag
# .. toggle_default: False
# .. toggle_description: This flag enables the use of content groups for teams.
# .. toggle_use_cases: open_edx
# .. toggle_creation_date: 2023-11-23
CONTENT_GROUPS_FOR_TEAMS = CourseWaffleFlag(
f"{COURSE_GROUPS_NAMESPACE}.content_groups_for_teams", __name__
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from django.conf import settings
from django.utils.translation import gettext_lazy as _
from openedx.core.djangoapps.course_groups.partition_scheme import CONTENT_GROUPS_FOR_TEAMS
from openedx.core.djangoapps.course_groups.flags import CONTENT_GROUPS_FOR_TEAMS

from xmodule.partitions.partitions import UserPartition, UserPartitionError
from xmodule.services import TeamsConfigurationService
Expand Down
13 changes: 1 addition & 12 deletions openedx/core/djangoapps/course_groups/partition_scheme.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,11 @@
UserPartition
)
from xmodule.services import TeamsConfigurationService
from openedx.core.djangoapps.waffle_utils import CourseWaffleFlag
from openedx.core.djangoapps.course_groups.flags import CONTENT_GROUPS_FOR_TEAMS

from .cohorts import get_cohort, get_group_info_for_cohort

log = logging.getLogger(__name__)
COURSE_GROUPS_NAMESPACE = "course_groups"

# .. toggle_name: course_groups.content_groups_for_teams
# .. toggle_implementation: CourseWaffleFlag
# .. toggle_default: False
# .. toggle_description: This flag enables the use of content groups for teams.
# .. toggle_use_cases: open_edx
# .. toggle_creation_date: 2023-11-23
CONTENT_GROUPS_FOR_TEAMS = CourseWaffleFlag(
f"{COURSE_GROUPS_NAMESPACE}.content_groups_for_teams", __name__
)


class CohortPartitionScheme:
Expand Down

0 comments on commit 829315e

Please sign in to comment.