Skip to content

Commit 2cd7532

Browse files
committed
Merge remote-tracking branch 'origin/master' into braden/units-api
2 parents 42bccba + eb03cfb commit 2cd7532

60 files changed

Lines changed: 625 additions & 815 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintignore

Lines changed: 0 additions & 82 deletions
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 77 deletions
This file was deleted.

.github/workflows/quality-checks.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,29 +60,28 @@ jobs:
6060
PIP_SRC: ${{ runner.temp }}
6161
run: |
6262
make test-requirements
63-
63+
6464
- name: Install npm
6565
env:
6666
PIP_SRC: ${{ runner.temp }}
67-
run: npm ci
68-
67+
run: npm ci
68+
6969
- name: Install python packages
7070
env:
7171
PIP_SRC: ${{ runner.temp }}
7272
run: |
7373
pip install -e .
74-
74+
7575
- name: Run Quality Tests
7676
env:
7777
PIP_SRC: ${{ runner.temp }}
7878
TARGET_BRANCH: ${{ github.base_ref }}
7979
run: |
8080
make pycodestyle
81-
npm run lint
8281
make xsslint
8382
make pii_check
8483
make check_keywords
85-
84+
8685
- name: Save Job Artifacts
8786
if: always()
8887
uses: actions/upload-artifact@v4

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ Open edX Platform
1212

1313
Purpose
1414
*******
15-
The `Open edX Platform <https://openedx.org>`_ is a service-oriented platform for authoring and
16-
delivering online learning at any scale. The platform is written in
15+
The `Open edX Platform <https://openedx.org>`_ enables the authoring and
16+
delivery of online learning at any scale. The platform is written in
1717
Python and JavaScript and makes extensive use of the Django
1818
framework. At the highest level, the platform is composed of a
19-
monolith, some independently deployable applications (IDAs), and
19+
modular monolith, some independently deployable applications (IDAs), and
2020
micro-frontends (MFEs) based on the ReactJS.
2121

2222
This repository hosts the monolith at the center of the Open edX

cms/djangoapps/cms_user_tasks/signals.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,16 @@ def get_olx_validation_from_artifact():
8686
reverse('usertaskstatus-detail', args=[status.uuid])
8787
)
8888

89+
# check if this is a course optimizer task
90+
is_course_optimizer_task = False
91+
course_optimizer_artifact = UserTaskArtifact.objects.filter(status=status, name="BrokenLinks").first()
92+
if course_optimizer_artifact:
93+
is_course_optimizer_task = True
94+
8995
user_email = status.user.email
9096
olx_validation_text = get_olx_validation_from_artifact()
91-
task_args = [task_name, str(status.state_text), user_email, detail_url, olx_validation_text]
97+
task_args = [task_name, str(status.state_text), user_email, detail_url,
98+
olx_validation_text, is_course_optimizer_task]
9299
try:
93100
send_task_complete_email.delay(*task_args)
94101
except Exception: # pylint: disable=broad-except

cms/djangoapps/cms_user_tasks/tasks.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,18 @@
2121

2222
@shared_task(bind=True)
2323
@set_code_owner_attribute
24-
def send_task_complete_email(self, task_name, task_state_text, dest_addr, detail_url, olx_validation_text=None):
24+
def send_task_complete_email(self, task_name, task_state_text, dest_addr, detail_url,
25+
olx_validation_text=None, is_course_optimizer_task=False):
2526
"""
2627
Sending an email to the users when an async task completes.
2728
"""
2829
retries = self.request.retries
29-
3030
context = {
3131
'task_name': task_name,
3232
'task_status': task_state_text,
3333
'detail_url': detail_url,
3434
'olx_validation_errors': {},
35+
'is_course_optimizer_task': is_course_optimizer_task,
3536
}
3637
if olx_validation_text:
3738
try:

cms/djangoapps/contentstore/tasks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,15 +1215,15 @@ def _get_urls(content):
12151215
"""
12161216
Finds and returns a list of URLs in the given content.
12171217
Includes strings following 'href=' and 'src='.
1218-
Excludes strings that are only '#'.
1218+
Excludes strings that are only '#' or start with 'data:'.
12191219
12201220
Arguments:
12211221
content (str): entire content of a block
12221222
12231223
Returns:
12241224
list: urls
12251225
"""
1226-
regex = r'\s+(?:href|src)=["\'](?!#)([^"\']*)["\']'
1226+
regex = r'\s+(?:href|src)=["\'](?!#|data:)([^"\']*)["\']'
12271227
url_list = re.findall(regex, content)
12281228
return url_list
12291229

cms/djangoapps/contentstore/tests/test_tasks.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,3 +577,28 @@ def test_convert_to_standard_url(self):
577577
expected,
578578
f"Failed for URL: {url}",
579579
)
580+
581+
def test_get_urls(self):
582+
"""Test _get_urls function for correct URL extraction."""
583+
584+
content = '''
585+
<a href="https://example.com">Link</a>
586+
<img src="https://images.com/pic.jpg">
587+
<link href="https://fonts.googleapis.com/css?family=Roboto">
588+
<a href="#">Home</a>
589+
<a href="https://validsite.com">Valid</a>
590+
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...">
591+
<a href="data:application/pdf;base64,JVBERi0xLjQK...">
592+
<a href="https://another-valid.com">Another</a>
593+
<p>No links here!</p>
594+
<img alt="Just an image without src">
595+
'''
596+
597+
expected = [
598+
"https://example.com",
599+
"https://images.com/pic.jpg",
600+
"https://fonts.googleapis.com/css?family=Roboto",
601+
"https://validsite.com",
602+
"https://another-valid.com"
603+
]
604+
self.assertEqual(_get_urls(content), expected)

cms/static/js/features_jsx/.eslintrc.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

cms/templates/emails/user_task_complete_email.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33

44
${_("Your {task_name} task has completed with the status '{task_status}'. Use this URL to view task details or download any files created: {detail_url}").format(task_name=task_name, task_status=task_status, detail_url=detail_url)}
55

6+
% elif is_course_optimizer_task:
7+
8+
${_("Your {task_name} task has completed with the status '{task_status}'. Sign in to view the details of your task.").format(task_name=task_name, task_status=task_status)}
9+
610
% else:
711

812
${_("Your {task_name} task has completed with the status '{task_status}'. Sign in to view the details of your task or download any files created.").format(task_name=task_name, task_status=task_status)}

0 commit comments

Comments
 (0)