Skip to content

Commit

Permalink
Merge branch 'master' into MJG/dynamic-team-partition
Browse files Browse the repository at this point in the history
  • Loading branch information
mariajgrimaldi authored Apr 12, 2024
2 parents deb48df + d98164f commit 8e81327
Show file tree
Hide file tree
Showing 30 changed files with 33,860 additions and 29,017 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/js-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-20.04 ]
node-version: [ 18 ]
node-version: [ 16 ]
python-version: [ 3.8 ]

steps:
Expand All @@ -28,13 +28,13 @@ jobs:
node-version: ${{ matrix.node-version }}

- name: Setup npm
run: npm i -g npm@10.5.x
run: npm i -g npm@8.5.x

- name: Install Firefox 123.0
- name: Install Firefox 61.0
run: |
sudo apt-get purge firefox
wget "https://ftp.mozilla.org/pub/firefox/releases/123.0/linux-x86_64/en-US/firefox-123.0.tar.bz2"
tar -xjf firefox-123.0.tar.bz2
wget "https://ftp.mozilla.org/pub/firefox/releases/61.0/linux-x86_64/en-US/firefox-61.0.tar.bz2"
tar -xjf firefox-61.0.tar.bz2
sudo mv firefox /opt/firefox
sudo ln -s /opt/firefox/firefox /usr/bin/firefox
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lockfileversion-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ on:

jobs:
version-check:
uses: openedx/.github/.github/workflows/lockfileversion-check-v3.yml@master
uses: openedx/.github/.github/workflows/lockfileversion-check.yml@master
4 changes: 2 additions & 2 deletions .github/workflows/static-assets-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
matrix:
os: [ ubuntu-20.04 ]
python-version: [ 3.8 ]
node-version: [ 18 ]
npm-version: [ 10.5.x ]
node-version: [ 16 ]
npm-version: [ 8.5.x ]
mongo-version: ["4.4", "7.0"]

services:
Expand Down
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ RUN pip install -r requirements/pip.txt
RUN pip install -r requirements/edx/base.txt

# Install node and npm
RUN nodeenv /edx/app/edxapp/nodeenv --node=18.19.0 --prebuilt
RUN npm install -g npm@10.5.x
RUN nodeenv /edx/app/edxapp/nodeenv --node=16.14.0 --prebuilt
RUN npm install -g npm@8.5.x

# This script is used by an npm post-install hook.
# We copy it into the image now so that it will be available when we run `npm install` in the next step.
Expand Down
14 changes: 8 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,16 @@ recommend that you use a service provider to run the software for you. They
have free trials that make it easy to get started:
https://openedx.org/get-started/

If you will be modifying edx-platform code, the `Open edX Developer Stack`_ (Devstack) is
a Docker-based development environment.
If you will be modifying edx-platform code, `Tutor`_ is
the community-supported Docker-based Open edX distribution, both for production and
local development. The goal of Tutor is to make it easy to deploy, customise,
upgrade and scale your Open edX installation.

If you want to run your own Open edX server and have the technical skills to do
so, `Open edX Installation Options`_ explains your options.
You can read more about getting up and running with a Tutor deployment
at the `Site Ops home on docs.openedx.org`_.

.. _Open edX Developer Stack: https://github.com/openedx/devstack
.. _Open edX Installation Options: https://openedx.atlassian.net/wiki/spaces/OpenOPS/pages/60227779/Open+edX+Installation+Options
.. _Tutor: https://github.com/overhangio/tutor
.. _Site Ops home on docs.openedx.org: https://docs.openedx.org/en/latest/site_ops/index.html

Dependencies
============
Expand Down
4 changes: 4 additions & 0 deletions cms/djangoapps/contentstore/rest_api/v0/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
TranscriptView,
YoutubeTranscriptCheckView,
YoutubeTranscriptUploadView,
APIHeartBeatView
)
from .views import assets
from .views import authoring_videos
Expand Down Expand Up @@ -45,6 +46,9 @@
),

# Authoring API
re_path(
r'^heartbeat$', APIHeartBeatView.as_view(), name='heartbeat'
),
re_path(
fr'^file_assets/{settings.COURSE_ID_PATTERN}$',
assets.AssetsCreateRetrieveView.as_view(), name='cms_api_create_retrieve_assets'
Expand Down
1 change: 1 addition & 0 deletions cms/djangoapps/contentstore/rest_api/v0/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
from .advanced_settings import AdvancedCourseSettingsView
from .tabs import CourseTabSettingsView, CourseTabListView, CourseTabReorderView
from .transcripts import TranscriptView, YoutubeTranscriptCheckView, YoutubeTranscriptUploadView
from .api_heartbeat import APIHeartBeatView
48 changes: 48 additions & 0 deletions cms/djangoapps/contentstore/rest_api/v0/views/api_heartbeat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
""" View For Getting the Status of The Authoring API """
import edx_api_doc_tools as apidocs
from rest_framework.views import APIView
from rest_framework.request import Request
from rest_framework.response import Response
from rest_framework import status
from openedx.core.lib.api.view_utils import DeveloperErrorViewMixin, view_auth_classes
import cms.djangoapps.contentstore.toggles as toggles


class APIHeartBeatView(DeveloperErrorViewMixin, APIView):
"""
View for getting the Authoring API's status
"""

@apidocs.schema(
parameters=[],
responses={
200: "The API is online",
401: "The requester is not authenticated.",
403: "The API is not availible",
},
)
@view_auth_classes(is_authenticated=True)
def get(self, request: Request):
"""
Get an object containing the Authoring API's status
**Example Request**
GET /api/contentstore/v0/heartbeat
**Response Values**
If the request is successful, an HTTP 200 "OK" response is returned.
The HTTP 200 response contains a single dict with the "authoring_api_enabled" value "True".
**Example Response**
```json
{
"authoring_api_enabled": "True"
}
```
"""
if toggles.use_studio_content_api():
return Response({'status': 'heartbeat successful'}, status=status.HTTP_200_OK)
return Response(status=status.HTTP_403_FORBIDDEN)
4 changes: 2 additions & 2 deletions common/test/data/course_after_rename/about/overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h2>Requirements</h2>
<h2>Course Staff</h2>
<article class="teacher">
<div class="teacher-image">
<img src="/static/images/placeholder-faculty.png" align="left" style="margin: 0 20px 0;" alt="Course Staff Image #1" />
<img src="/static/images/placeholder-faculty.png" align="left" alt="Course Staff Image #1" />
</div>

<h3>Staff Member #1</h3>
Expand All @@ -23,7 +23,7 @@ <h3>Staff Member #1</h3>

<article class="teacher">
<div class="teacher-image">
<img src="/static/images/placeholder-faculty.png" align="left" style="margin: 0 20px 0;" alt="Course Staff Image #2" />
<img src="/static/images/placeholder-faculty.png" align="left" alt="Course Staff Image #2" />
</div>

<h3>Staff Member #2</h3>
Expand Down
4 changes: 2 additions & 2 deletions common/test/data/course_before_rename/about/overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h2>Requirements</h2>
<h2>Course Staff</h2>
<article class="teacher">
<div class="teacher-image">
<img src="/static/images/placeholder-faculty.png" align="left" style="margin: 0 20px 0;" alt="Course Staff Image #1" />
<img src="/static/images/placeholder-faculty.png" align="left" alt="Course Staff Image #1" />
</div>

<h3>Staff Member #1</h3>
Expand All @@ -23,7 +23,7 @@ <h3>Staff Member #1</h3>

<article class="teacher">
<div class="teacher-image">
<img src="/static/images/placeholder-faculty.png" align="left" style="margin: 0 20px 0;" alt="Course Staff Image #2" />
<img src="/static/images/placeholder-faculty.png" align="left" alt="Course Staff Image #2" />
</div>

<h3>Staff Member #2</h3>
Expand Down
4 changes: 2 additions & 2 deletions common/test/data/course_info_updates/about/overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h2>Prerequisites</h2>
<h2>Course Staff</h2>
<article class="teacher">
<div class="teacher-image">
<img src="/static/images/placeholder-faculty.png" align="left" style="margin: 0 20px 0;" alt="Course Staff Image #1" />
<img src="/static/images/placeholder-faculty.png" align="left" alt="Course Staff Image #1" />
</div>

<h3>Staff Member #1</h3>
Expand All @@ -23,7 +23,7 @@ <h3>Staff Member #1</h3>

<article class="teacher">
<div class="teacher-image">
<img src="/static/images/placeholder-faculty.png" align="left" style="margin: 0 20px 0;" alt="Course Staff Image #2" />
<img src="/static/images/placeholder-faculty.png" align="left" alt="Course Staff Image #2" />
</div>

<h3>Staff Member #2</h3>
Expand Down
4 changes: 2 additions & 2 deletions common/test/data/manual-testing-complete/about/overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h2>Prerequisites</h2>
<h2>Course Staff</h2>
<article class="teacher">
<div class="teacher-image">
<img src="/static/images/placeholder-faculty.png" align="left" style="margin: 0 20px 0;" alt="Course Staff Image #1" />
<img src="/static/images/placeholder-faculty.png" align="left" alt="Course Staff Image #1" />
</div>

<h3>Staff Member #1</h3>
Expand All @@ -23,7 +23,7 @@ <h3>Staff Member #1</h3>

<article class="teacher">
<div class="teacher-image">
<img src="/static/images/placeholder-faculty.png" align="left" style="margin: 0 20px 0;" alt="Course Staff Image #2" />
<img src="/static/images/placeholder-faculty.png" align="left" alt="Course Staff Image #2" />
</div>

<h3>Staff Member #2</h3>
Expand Down
4 changes: 2 additions & 2 deletions common/test/data/scoreable/about/overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h2>Requirements</h2>
<h2>Course Staff</h2>
<article class="teacher">
<div class="teacher-image">
<img src="/static/images/placeholder-faculty.png" align="left" style="margin: 0 20px 0;" alt="Course Staff Image #1" />
<img src="/static/images/placeholder-faculty.png" align="left" alt="Course Staff Image #1" />
</div>

<h3>Staff Member #1</h3>
Expand All @@ -23,7 +23,7 @@ <h3>Staff Member #1</h3>

<article class="teacher">
<div class="teacher-image">
<img src="/static/images/placeholder-faculty.png" align="left" style="margin: 0 20px 0;" alt="Course Staff Image #2" />
<img src="/static/images/placeholder-faculty.png" align="left" alt="Course Staff Image #2" />
</div>

<h3>Staff Member #2</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def validate_social_link(self, social_platform, link):
('twitter', 'https://www.twiter.com/edX/', None, False),
('twitter', 'https://www.twitter.com/edX/123s', None, False),
('twitter', 'twitter.com/edX', 'https://www.twitter.com/edX', True),
('twitter', 'twitter.com/edX?foo=bar', 'https://www.twitter.com/edX', True),
('twitter', 'twitter.com/edX?foo=bar', 'https://www.twitter.com/edX?foo=bar', True),
('twitter', 'twitter.com/test.user', 'https://www.twitter.com/test.user', True),
('linkedin', 'www.linkedin.com/harryrein', None, False),
('linkedin', 'www.linkedin.com/in/harryrein-1234', 'https://www.linkedin.com/in/harryrein-1234', True),
Expand Down
7 changes: 2 additions & 5 deletions openedx/core/djangoapps/user_api/accounts/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import random
import re
import string
from urllib.parse import urlparse # pylint: disable=import-error

import waffle # lint-amnesty, pylint: disable=invalid-django-waffle-import
from completion.models import BlockCompletion
Expand Down Expand Up @@ -85,11 +84,9 @@ def _get_username_from_social_link(platform_name, new_social_link):
if not new_social_link:
return new_social_link

# Parse the social link as if it were a URL.
parse_result = urlparse(new_social_link)
url_domain_and_path = parse_result[1] + parse_result[2]
url_stub = re.escape(settings.SOCIAL_PLATFORMS[platform_name]['url_stub'])
username_match = re.search(r'(www\.)?' + url_stub + r'(?P<username>.*?)[/]?$', url_domain_and_path, re.IGNORECASE)
username_match = re.search(r'(www\.)?' + url_stub + r'(?P<username>.+?)(?:/)?$', new_social_link, re.IGNORECASE)

if username_match:
username = username_match.group('username')
else:
Expand Down
Loading

0 comments on commit 8e81327

Please sign in to comment.