Skip to content

Commit

Permalink
feat: Add default setting DEFAULT_CERTIFICATES_DISPLAY_BEHAVIOR
Browse files Browse the repository at this point in the history
Adding a default setting will allow more flexible control over
certificate creation behavior at the global level.
  • Loading branch information
Dima Alipov committed Jul 31, 2024
1 parent 46c972e commit 43c2ffa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
PROFILE_IMAGE_HASH_SEED, PROFILE_IMAGE_MIN_BYTES, PROFILE_IMAGE_MAX_BYTES, PROFILE_IMAGE_SIZES_MAP,
# The following setting is included as it is used to check whether to
# display credit eligibility table on the CMS or not.
COURSE_MODE_DEFAULTS, DEFAULT_COURSE_ABOUT_IMAGE_URL,
COURSE_MODE_DEFAULTS, DEFAULT_COURSE_ABOUT_IMAGE_URL, DEFAULT_CERTIFICATES_DISPLAY_BEHAVIOR,

# User-uploaded content
MEDIA_ROOT,
Expand Down
3 changes: 3 additions & 0 deletions lms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
from openedx.core.lib.derived import derived, derived_collection_entry
from openedx.core.release import doc_version
from lms.djangoapps.lms_xblock.mixin import LmsBlockMixin
from xmodule.data import CertificatesDisplayBehaviors

################################### FEATURES ###################################
# .. setting_name: PLATFORM_NAME
Expand Down Expand Up @@ -1548,6 +1549,8 @@ def _make_mako_template_dirs(settings):
USERNAME_REGEX_PARTIAL = r'[\w .@_+-]+'
USERNAME_PATTERN = fr'(?P<username>{USERNAME_REGEX_PARTIAL})'

######## Settings for the default display behavior of course certificates ###########
DEFAULT_CERTIFICATES_DISPLAY_BEHAVIOR = CertificatesDisplayBehaviors.END.value

############################## EVENT TRACKING #################################
LMS_SEGMENT_KEY = None
Expand Down
3 changes: 1 addition & 2 deletions xmodule/course_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from openedx.core.lib.teams_config import TeamsConfig # lint-amnesty, pylint: disable=unused-import
from xmodule import course_metadata_utils
from xmodule.course_metadata_utils import DEFAULT_GRADING_POLICY, DEFAULT_START_DATE
from xmodule.data import CertificatesDisplayBehaviors
from xmodule.graders import grader_from_conf
from xmodule.seq_block import SequenceBlock
from xmodule.tabs import CourseTabList, InvalidTabsException
Expand Down Expand Up @@ -588,7 +587,7 @@ class CourseFields: # lint-amnesty, pylint: disable=missing-class-docstring
"user can see their certificate for the course"
),
scope=Scope.settings,
default=CertificatesDisplayBehaviors.END.value,
default=settings.DEFAULT_CERTIFICATES_DISPLAY_BEHAVIOR
)
course_image = String(
display_name=_("Course About Page Image"),
Expand Down

0 comments on commit 43c2ffa

Please sign in to comment.