Skip to content

Commit

Permalink
Merge branch 'master' into renovate/formik-2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
marslanabdulrauf authored Dec 27, 2024
2 parents 5e9e5ca + 6b4c11e commit 33a4e0d
Show file tree
Hide file tree
Showing 74 changed files with 2,328 additions and 1,017 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ HUBSPOT_ID_PREFIX=
MITOL_DIGITAL_CREDENTIALS_VERIFY_SERVICE_BASE_URL=http://host.docker.internal:5000/
MITOL_DIGITAL_CREDENTIALS_HMAC_SECRET=test-hmac-secret # pragma: allowlist secret

EMERITUS_API_KEY=fake_api_key
EXTERNAL_COURSE_SYNC_API_KEY=fake_api_key

POSTHOG_PROJECT_API_KEY=
POSTHOG_API_HOST=https://app.posthog.com/
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres # pragma: allowlist secret
WEBPACK_DISABLE_LOADER_STATS: "True"
ELASTICSEARCH_URL: localhost:9200
EMERITUS_API_KEY: fake_emeritus_api_key # pragma: allowlist secret
EXTERNAL_COURSE_SYNC_API_KEY: fake_external_course_sync_api_key # pragma: allowlist secret
MAILGUN_KEY: fake_mailgun_key
MAILGUN_SENDER_DOMAIN: other.fake.site
MITOL_DIGITAL_CREDENTIALS_VERIFY_SERVICE_BASE_URL: http://localhost:5000
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repos:
- id: check-toml
- id: debug-statements
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.10.0-1
rev: v3.10.0-2
hooks:
- id: shfmt
- repo: https://github.com/adrienverge/yamllint.git
Expand Down Expand Up @@ -51,7 +51,7 @@ repos:
- --exclude-files
- "_test.js$"
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.7.4"
rev: "v0.8.4"
hooks:
- id: ruff-format
- id: ruff
Expand Down
32 changes: 32 additions & 0 deletions RELEASE.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,38 @@
Release Notes
=============

Version 0.166.0 (Released December 16, 2024)
---------------

- feat: add Global Alumni in external course sync (#3330)
- [pre-commit.ci] pre-commit autoupdate (#3332)

Version 0.165.0 (Released December 11, 2024)
---------------

- chore: change backend name (#3327)

Version 0.164.3 (Released December 05, 2024)
---------------

- feat: add emeritus api list view (#3329)
- [pre-commit.ci] pre-commit autoupdate (#3326)

Version 0.164.2 (Released December 02, 2024)
---------------

- feat(api): has_prerequisites field added in courses and programs API (#3306)
- Revert "fix(deps): update dependency sass to ~1.81.0" (#3323)
- chore(deps): Remove unused package 'set-value' (#3307)
- perf: select related objects for course and courserun admin (#3316)
- chore(deps): update codecov/codecov-action action to v5 (#3314)
- fix: strip emeritus course title during sync (#3317)
- [pre-commit.ci] pre-commit autoupdate (#3315)
- fix(deps): update dependency sass to ~1.81.0 (#3313)
- chore(deps): update postgres docker tag to v17.1 (#3312)
- chore(deps): update dependency faker to v30.10.0 (#3311)
- fix(deps): update dependency boto3 to v1.35.63 (#3310)

Version 0.164.1 (Released November 21, 2024)
---------------

Expand Down
36 changes: 22 additions & 14 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@
"description": "'hours' value for the 'generate-course-certificate' scheduled task (defaults to midnight)",
"required": false
},
"CRON_EMERITUS_COURSERUN_SYNC_DAYS": {
"description": "'day_of_week' value for 'sync-emeritus-course-runs' scheduled task (default will run once a day).",
"CRON_EXTERNAL_COURSERUN_SYNC_DAYS": {
"description": "'day_of_week' value for 'sync-external-course-runs' scheduled task (default will run once a day).",
"required": false
},
"CRON_EMERITUS_COURSERUN_SYNC_HOURS": {
"description": "'hours' value for the 'sync-emeritus-course-runs' scheduled task (defaults to midnight)",
"CRON_EXTERNAL_COURSERUN_SYNC_HOURS": {
"description": "'hours' value for the 'sync-external-course-runs' scheduled task (defaults to midnight)",
"required": false
},
"CSRF_TRUSTED_ORIGINS": {
Expand Down Expand Up @@ -234,20 +234,20 @@
"description": "Timeout (in seconds) for requests made via the edX API client",
"required": false
},
"EMERITUS_API_BASE_URL": {
"description": "Base API URL for Emeritus API",
"ENROLLMENT_CHANGE_SHEET_ID": {
"description": "ID of the Google Sheet that contains the enrollment change request worksheets (refunds, transfers, etc)",
"required": false
},
"EMERITUS_API_KEY": {
"description": "The API Key for Emeritus API",
"required": true
},
"EMERITUS_API_TIMEOUT": {
"description": "API request timeout for Emeritus APIs in seconds",
"EXTERNAL_COURSE_SYNC_API_BASE_URL": {
"description": "Base API URL for external course sync API",
"required": false
},
"ENROLLMENT_CHANGE_SHEET_ID": {
"description": "ID of the Google Sheet that contains the enrollment change request worksheets (refunds, transfers, etc)",
"EXTERNAL_COURSE_SYNC_API_KEY": {
"description": "The API Key for external course sync API",
"required": true
},
"EXTERNAL_COURSE_SYNC_API_REQUEST_TIMEOUT": {
"description": "API request timeout for external course sync APIs in seconds",
"required": false
},
"GA_TRACKING_ID": {
Expand Down Expand Up @@ -482,6 +482,10 @@
"description": "The 'name' value for the Open edX OAuth Application",
"required": true
},
"OPENEDX_OAUTH_PROVIDER": {
"description": "Social auth oauth provider backend name",
"required": false
},
"OPENEDX_SERVICE_WORKER_API_TOKEN": {
"description": "Active access token with staff level permissions to use with OpenEdX API client for service tasks",
"required": false
Expand All @@ -490,6 +494,10 @@
"description": "Username of the user whose token has been set in OPENEDX_SERVICE_WORKER_API_TOKEN",
"required": false
},
"OPENEDX_SOCIAL_LOGIN_PATH": {
"description": "Open edX social auth login url",
"required": false
},
"OPENEDX_TOKEN_EXPIRES_HOURS": {
"description": "The number of hours until an access token for the Open edX API expires",
"required": false
Expand Down
2 changes: 1 addition & 1 deletion authentication/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def process_exception(self, request, exception):
url = self.get_redirect_uri(request, exception)

if url: # noqa: RET503
url += ("?" in url and "&" or "?") + "message={}&backend={}".format( # noqa: UP032
url += (("?" in url and "&") or "?") + "message={}&backend={}".format( # noqa: UP032
quote(message), backend_name
)
return redirect(url)
2 changes: 1 addition & 1 deletion b2b_ecommerce/api_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@


@pytest.fixture(autouse=True)
def cybersource_settings(settings): # noqa: PT004
def cybersource_settings(settings):
"""
Set cybersource settings
"""
Expand Down
2 changes: 1 addition & 1 deletion b2b_ecommerce/views_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@


@pytest.fixture(autouse=True)
def ecommerce_settings(settings): # noqa: PT004
def ecommerce_settings(settings):
"""
Set cybersource settings
"""
Expand Down
1 change: 1 addition & 0 deletions cms/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
WEBINAR_INDEX_SLUG = "webinars"
BLOG_INDEX_SLUG = "blog"
ENTERPRISE_PAGE_SLUG = "enterprise"
COMMON_COURSEWARE_COMPONENT_INDEX_SLUG = "common-courseware-component-pages"

ALL_TOPICS = "All Topics"
ALL_TAB = "all-tab"
Expand Down
48 changes: 46 additions & 2 deletions cms/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,22 @@
SuccessStoriesBlock,
UserTestimonialBlock,
)
from cms.constants import UPCOMING_WEBINAR
from cms.constants import COMMON_COURSEWARE_COMPONENT_INDEX_SLUG, UPCOMING_WEBINAR
from cms.models import (
BlogIndexPage,
CatalogPage,
CertificatePage,
CommonComponentIndexPage,
CompaniesLogoCarouselSection,
CourseIndexPage,
CourseOverviewPage,
CoursePage,
CoursesInProgramPage,
EnterprisePage,
ExternalCoursePage,
ExternalProgramPage,
FacultyMembersPage,
ForTeamsCommonPage,
ForTeamsPage,
FrequentlyAskedQuestion,
FrequentlyAskedQuestionPage,
Expand All @@ -36,6 +39,7 @@
LearningJourneySection,
LearningOutcomesPage,
LearningStrategyFormSection,
LearningTechniquesCommonPage,
LearningTechniquesPage,
NewsAndEventsBlock,
NewsAndEventsPage,
Expand All @@ -52,7 +56,7 @@
WebinarPage,
WhoShouldEnrollPage,
)
from courses.factories import CourseFactory, ProgramFactory
from courses.factories import CourseFactory, PlatformFactory, ProgramFactory

factory.Faker.add_provider(internet)

Expand Down Expand Up @@ -576,3 +580,43 @@ class LearningStrategyFormPageFactory(wagtail_factories.PageFactory):

class Meta:
model = LearningStrategyFormSection


class CourseOverviewPageFactory(wagtail_factories.PageFactory):
"""CourseOverviewPage factory class"""

heading = factory.fuzzy.FuzzyText(prefix="heading ")
overview = factory.LazyFunction(lambda: RichText(f"<p>{FAKE.paragraph()}</p>"))

class Meta:
model = CourseOverviewPage


class CommonComponentIndexPageFactory(wagtail_factories.PageFactory):
"""CommonComponentIndexPage factory class"""

title = factory.fuzzy.FuzzyText()
slug = COMMON_COURSEWARE_COMPONENT_INDEX_SLUG

class Meta:
model = CommonComponentIndexPage


class LearningTechniqueCommonPageFactory(LearningTechniquesPageFactory):
"""LearningTechniquesCommonPage factory class"""

platform = factory.SubFactory(PlatformFactory)
title = factory.fuzzy.FuzzyText()

class Meta:
model = LearningTechniquesCommonPage


class ForTeamsCommonPageFactory(ForTeamsPageFactory):
"""ForTeamsCommonPage factory class"""

platform = factory.SubFactory(PlatformFactory)
title = factory.fuzzy.FuzzyText()

class Meta:
model = ForTeamsCommonPage
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""Management command to create How You Will Learn and B2B sections in external course pages"""

from django.core.management.base import BaseCommand

from cms.models import ExternalCoursePage
from cms.wagtail_hooks import create_common_child_pages_for_external_courses


class Command(BaseCommand):
"""Backfills How You Will Learn and B2B sections to external course pages"""

help = __doc__

def handle(self, *args, **options): # noqa: ARG002
for page in ExternalCoursePage.objects.all():
create_common_child_pages_for_external_courses(None, page)
54 changes: 54 additions & 0 deletions cms/migrations/0073_course_overview_page.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Generated by Django 4.2.16 on 2024-12-04 15:27

import django.db.models.deletion
import wagtail.fields
from django.db import migrations, models

import cms.models


class Migration(migrations.Migration):
dependencies = [
("wagtailcore", "0089_log_entry_data_json_null_to_object"),
("cms", "0072_add_hybrid_courseware_format_option"),
]

operations = [
migrations.CreateModel(
name="CourseOverviewPage",
fields=[
(
"page_ptr",
models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
primary_key=True,
serialize=False,
to="wagtailcore.page",
),
),
(
"heading",
models.CharField(
blank=True,
help_text="The Heading to show in this section.",
max_length=255,
null=True,
),
),
(
"overview",
wagtail.fields.RichTextField(
blank=True,
help_text="An overview to provide additional context or information about the course",
null=True,
),
),
],
options={
"verbose_name": "Course Overview",
},
bases=(cms.models.DisableSitemapURLMixin, "wagtailcore.page"),
),
]
Loading

0 comments on commit 33a4e0d

Please sign in to comment.