Commit Graph

9582 Commits

Author SHA1 Message Date
Usama Sadiq
484cd536e2 fix: Fixed new pylint warnings (#28724) 2021-09-23 17:54:04 +05:00
sarina
0c74d347f7 fix: abstract edX-specific strings 2021-09-19 14:01:20 -04:00
Tim McCormack
dbb473f490 refactor: Studio OAuth cleanup, part 1 (#28760)
- Update migration instructions
    - Changes regarding redirect URLs and cookie domain are to permit the
      site to run on multiple domains.
- Set LOGIN_URL in common so that it can be unset in environment overrides

This bypasses the "redirect to LMS" login/signup code, but does not yet
remove it; removal is covered by DEPR-166 so that this remains a
configuration-only change for now.

There should have no user-visible effect.

ref: ARCHBOM-1890
2021-09-16 16:16:45 +00:00
edX Transifex Bot
879f0262fd chore(i18n): update translations 2021-09-15 23:39:09 +05:00
Kyle McCormick
d701b423f1 fix: repair search of course creator statuses in django admin
It was broken because "organizations" was erronously included
in the `search_fields` admin option. Many-to-many fields
may not be used for search.

TNL-8722
2021-09-14 13:31:08 -04:00
Kyle McCormick
f0239b724e fix: show creation rights notice on studio "courses" tab
There was a JS bug that made it so the course creation rights
notice (the thing that invites new studio users to request
access to create content) disappeared if the user selected
the "Courses" or "Libraries" tab.

This is because it was incorrectly comparing the #courses-tab
URL frament against the string "courses" instead of "courses-tab".

TNL-8718
2021-09-14 13:31:08 -04:00
Awais Qureshi
f0cd6d78f5 Merge pull request #28707 from edx/dj30-regex-issue-re-path
fix: RegexPattern, used by re_path(), no longer returns keyword argum…
2021-09-13 18:52:24 +05:00
edX Transifex Bot
6e9d448a19 chore(i18n): update translations 2021-09-13 02:45:53 +05:00
Tim McCormack
0c164ad4c2 fix: Fix Studio logout by pointing to correct logout view (#28714)
This changes the "Sign out" link on Studio to point to Studio's own logout
view, which clears the session and then redirects to LMS's logout page. The
LMS logout page then skips loading the Studio logout because it is seen in
the Referer header.

This change also brings Studio better into line with how other IDAs perform
their logouts.

Background:

After the rollout of Studio OAuth, logouts initiated on Studio failed to
actually log out Studio (but all other IDAs were logged out). This was
because the LMS logout view loads the logout pages of other IDAs but skips
any that is a *prefix* match on the Referer header, and browsers now often
send a truncated version of the Referer for privacy. Therefore, Studio was
always skipped when coming from Studio.

The fix is to make sure that Studio has already performed its logout by the
time the LMS logout page is loaded.

One wrinkle here is that the LMS logout view is activated by `/logout`, but
the correct logout view (provided by auth_backends) is activated by
`/logout/` -- with a trailing slash. This is fragile and unfortunate, but
can be cleaned up when we later remove other leftovers of Studio's previous
ability to handle logistration.

ref: ARCHBOM-1897
2021-09-10 18:45:58 +00:00
Farhaan Bukhsh
48ad7effb1 feat: grant course/library creation rights by organization (#26616)
Current State (before this commit):

  Studio, as of today doesn't have a way to restrict a user to
  create a course in a particular organization. What Studio
  provides right now is a CourseCreator permission which gives
  an Admin the power to grant a user the permission to create
  a course.

  For example: If the Admin has given a user Spiderman the
  permission to create courses, Spiderman can now create courses
  in any organization i.e Marvel as well as DC.
  There is no way to restrict Spiderman from creating courses
  under DC.

Purpose of this commit:

  The changes done here gives Admin the ability to restrict a
  user on an Organization level from creating courses via the
  Course Creators section of the Studio Django administration
  panel.

  For example: Now, the Admin can give the user Spiderman the
  privilege of creating courses only under Marvel organization.
  The moment Spiderman tries to create a course under some
  other organization(i.e DC), Studio will show an error message.

  This change is available to all Studio instances that
  enable the FEATURES['ENABLE_CREATOR_GROUP'] flag.
  Regardless of the flag, it will not affect any instances that choose
  not to use it.

BB-3622
2021-09-10 12:43:26 -04:00
Awais Qureshi
8f2a4f87fb fix: RegexPattern, used by re_path(), no longer returns keyword arguments with None values to be passed to the view for the optional named groups that are missing.
BOM-2793
2021-09-10 16:51:13 +05:00
Awais Ansari
f59397e63f fix: update hover state for textbooks breadcrumbs (#28690) 2021-09-09 15:11:15 +05:00
Matt Hughes
7089a3fbb4 build: man. comm. fails more loudly when nothing to do
JIRA:EDUCATOR-5112
2021-09-08 13:51:14 -04:00
Tinuade Adeleke
5b9e84d321 feat: created custom pages course app plugin (#28579)
created CustomPagesCourseApp class

feat: created custom pages course app plugin

created CustomPagesCourseApp class
added CUSTOM_PAGES_HELP_URL to lms and cms settings
added entry point to setup.py

feat: added toggle to ENABLE_CUSTOM_PAGES in lms and cms settings

feat: removed the option to enable/disable the availability of custom pages course apps.
2021-09-08 12:44:37 +05:00
Jawayria
caf95002a2 Merge pull request #28403 from edx/jawayria/django32-settings
chore: Updated lms and cms settings
2021-09-07 19:27:10 +05:00
Awais Ansari
ffa492f258 Merge pull request #28629 from edx/aansari/TNL-8606
feat: Add breadcrumbs for textbooks screen
2021-09-07 13:08:47 +05:00
edX Transifex Bot
15b965c201 fix(i18n): update translations 2021-09-06 02:50:49 +05:00
Adolfo R. Brandes
d7d6df5498 fix: fetch commons.js from the correct URL [SE-4785]
This mirrors a fix in
[frontend-app-library-authoring](https://github.com/edx/frontend-app-library-authoring/pull/25/files#diff-4102b1726b612b7813106191ef87849273f5d89da904f5ab69fb1974a31987d5R307).
2021-09-03 09:27:42 -07:00
Awais Ansari
ca8c10096e refactor: remove an extra call for getting waffle flag 2021-09-03 18:33:25 +05:00
Awais Ansari
125ed250ed feat: Add breadcrumbs for textbooks screen 2021-09-03 18:33:25 +05:00
0x29a
586add5f7d fix: don't cache ajax request on course details page in Studio
Caching this was making the browser render a JSON with this request because of
the Backbone.js router.
2021-09-02 18:31:01 +02:00
Awais Qureshi
32053c6ab4 Merge pull request #28588 from edx/loading-cors-origins-with-shceme
feat: `djang-cor-headers` need schemes with urls. Condition added for future.
2021-09-02 16:45:49 +05:00
J. Victor Martins
14e2f29516 feat: Make content libraries an LTI 1.3 tool
Offers blockstore-based content through content libraries acting as an
LTI 1.3 tool:

- Content Library support LTI 1.3 launches offering blockstore-based
  content through resource links.

- Content Library support LTI 1.3. AGS, allowing gradebook updates from
  graded assignments.
2021-09-01 11:56:51 -07:00
edX requirements bot
5e84e3761f feat: djang-cor-headers need schemes with urls. Adding condition to switch lists with different version.
With the PR it will load the old `CORS_ORIGIN_WHITELIST` since there is no change in `djang-cor-headers` version. In next PR this version will get upgraded.
2021-09-01 23:02:45 +05:00
Tim McCormack
3e13441cab feat: Enable CookieNameChange in Studio in prep for session cookie rename (#28602)
ref: ARCHBOM-1887
2021-08-31 21:19:53 +00:00
Kshitij Sobti
8cf751a405 feat: Add REST APIs for course advanced settings and course tabs
This commit adds new APIs that allow MFEs to modify a course's advanced settings
and to update tab settings to show/hide/move tabs.
2021-08-31 11:11:46 +05:00
Maria Grimaldi
54627e1101 refactor: replace User for UserFactory and its methods
This change is done so the profile is automatically created for tests users
2021-08-30 11:03:49 -04:00
Usama Sadiq
cde050618e build: Moved user and group management commands and unit tests to edx-django-utils
- Removed manage_user and manage_group commands and their unit tests from edx-platform and added then to edx-django-utils.
- Modified User.post_save signal to ensure the user profile is created when manage_user management command is run to create a user.
- Added edx-django-utils to INSTALLED_APPS for LMS and Studio.
- Moved generate_password from openedx.core.djangoapps.user_authn.utils to edx_django_utils.user along with its unit test.
2021-08-30 12:03:37 +05:00
Tim McCormack
90b48d68b6 feat: Activate Studio SSO for devstack (#28534)
This also requires using different session cookie names in devstack for
LMS and Studio so that we can properly use the OAuth flow locally, rather
than just sharing a session cookie on the localhost domain. (Note that
ports are not used for cookie segmentation in browsers.)

This depends on the following provisioning PR:
https://github.com/edx/devstack/pull/825
2021-08-25 20:37:05 +00:00
Tim McCormack
f75ae33580 feat: Implement (but don't activate) LMS OAuth2 SSO login for Studio (#28533)
Once LOGIN_URL is changed for an environment, the OAuth flow will be
activated. (See included temporary doc.)

This is for ARCHBOM-1860: Convert Studio to use LMS OAuth login.
2021-08-25 16:16:48 +00:00
Maria Grimaldi
2ee52ea96c refactor: replace some create_user with UserFactory to avoid non-existent profile errors 2021-08-24 15:49:21 -04:00
edX Transifex Bot
11eee8ff5c fix(i18n): update translations 2021-08-24 00:39:21 +05:00
Ahtisham Shahid
377dec74aa feat: Added pages&resources url to missing pages (#28472)
* feat: Removed extra pages by using waffle flag

* refactor:moved pages_and_resources_url context in header file

* refactor: cleanup of header file

* refactor: removed redundant instances of mfe url from context

* fix: fixed pylint issues
2021-08-20 12:44:40 +05:00
Bianca Severino
1b1637f33f Merge pull request #28463 from edx/bseverino/proctoring-settings-url
[MST-859] Update proctored exam settings URL
2021-08-18 09:20:42 -04:00
Bianca Severino
1255bd8535 fix: update proctored exam settings URL
The proctored exam settings link now directs to a new modal view, rather
than the old exam settings page.
2021-08-17 15:06:53 -04:00
Dillon Dumesnil
09bc2d11e6 fix: Updating the branding/api.py to use unicode copyright
This is really just the change to use the unicode copyright symbol
and then rerunning the pull translations logic (minus the transifex step)
to update the eo files. The other changes were just picked up as part of
running those scripts
2021-08-16 09:43:26 -04:00
edX Transifex Bot
fb161be624 fix(i18n): update translations 2021-08-15 20:47:16 +00:00
Matt Tuchfarber
d53d8e45a5 refactor: Merge the openedx certs app with lms one (#28435)
* refactor: Merge the openedx certs app with lms one

Move the certs API from openedx into the lms certificates app.
Functionally, this is a no-op. Cleanup will happen in a subsequent
commit. This is simply a move.
2021-08-11 10:25:55 -04:00
Saad Yousaf
933edd27e5 Merge pull request #233 from edx/TNL-8593/security-fix
fix: update lxml parser for celery tasks to be more secure
2021-08-11 14:07:28 +05:00
Julia Eskew
7fc109ebcb fix: ES 7.10 is now the default ES version for devstack, so change the
default address for testing ES using integration tests in devstack.
2021-08-09 11:37:51 -04:00
Braden MacDonald
da09bcadc5 refactor: run modulestore tests in common/lib/... using Django
Does 3 things:
(1) Use django for modulestore tests
(2) Use normal LMS settings for modulestore tests instead of openedx/tests/settings.py
(3) Simplify some TestCase subclasses by converting them to use ModuleStoreTestCase


Details and rationale:

(1) Currently parts of the modulestore test suite are designed to run "without django", although there is still a lot of django functionality imported at times, and many of the tests do in fact use django. But for the upcoming PR #27565 (moving split's course indexes from MongoDB to MySQL), we will need to always have Django enabled. So this commit paves the way for that change.

(2) The previous tests that did use Django used a special settings file, openedx/tests/settings.py which made some debugging confusing because those tests had quite different django settings than other tests. This change deletes that file and runs the tests using the LMS test settings.

(3) The test suite also contains many different ways of initializing and testing a modulestore, with significant differences in their configuration, and also a lot of repetition. I find this makes understanding, debugging and writing tests more difficult. So this commit also reduces the number of different "test case using modulestore" base classes:

* Simplifies MixedWithOptionsTestCase and MixedSplitTestCase by making them simple subclasses of ModuleStoreTestCase.
* Removes PureModulestoreTestCase.
2021-08-05 12:20:19 -07:00
Braden MacDonald
188e9fb15e fix: use integer user IDs consistently for modulestore APIs/tests
Some actions in split modulestore record the user ID who requested the action. Currently, split modulestore doesn't care what data type you use for those user IDs. Most of the codebase uses integers, but some tests used username or email address strings.

My upcoming PR #27565 will move split modulestore's "course index" data from MongoDB into MySQL. In doing so, it requires that user IDs are always numeric. So this PR paves the way for that one by using numeric IDs consistently in all test cases. I believe the actual non-test code was already consistently using integer IDs.
2021-08-05 10:26:43 -07:00
SaadYousaf
bb80192f1c fix: update lxml parser for celery tasks to be more secure 2021-08-05 10:56:28 -04:00
Jawayria
f8d44650d3 chore: Updated lms and cms settings 2021-08-05 15:15:19 +05:00
Kshitij Sobti
6cbb9cbca3 feat: Supply documentation links for course apps from the backend (#28327)
Instead of hard-coding the "Learn More" and potentially other links for course
apps in the course authoring  MFEs this change loads those URLs from the
django settings as part of each individual course app.
2021-08-04 15:04:13 +05:00
Hamza Farooq
4a2549f49a fix: making LOGIN_REDIRECT_WHITELIST configurable through env files (#26760)
LOGIN_REDIRECT_WHITELIST has been used to filter redirect-url while processing logout requests but its configurations were not picked through environment files like lms.yml or studio.yml. This PR fixes that bug.
2021-08-03 08:29:23 -04:00
Matt Tuchfarber
4b254c16f9 fix: Fix translation string for studio settings (#28361) 2021-08-02 14:29:27 -04:00
sofiayoon
1ad615ef59 Merge pull request #28329 from edx/syoon/AA-945
fix: wrong start date is displayed in susbection modal
2021-08-02 11:50:03 -04:00
Matt Tuchfarber
622d56026c Certificate Display Settings revamp (round 2) (#28286)
feat: reimagine certificate display settings

The course settings `certificate_available_date` (CAD) and
`certificates_display_behavior` (CDB) were previously
acting indedependantly of one another. They now work in
tandem. This change:
- limits CDB to a dropdown
- removes "early_with_info" and adds "end_with_date"
- only takes CAD into account if "end_with_date" is selected
- Moves CDB to the main course schedule settings page
- updates CourseOverview model and CourseDetails objects to
validate these fields and choose sane defaults if they aren't
expected values

This work was previously done in bd9e7dd (complete with bugs), so this
version is toggleable via the ENABLE_V2_CERT_DISPLAY_SETTINGS setting
2021-08-02 11:30:15 -04:00
Sofia Yoon
a272dd54cf fix: wrong start date is displayed in susbection modal with xblock's start date so use course context's start date (AA-945) 2021-08-02 10:05:50 -04:00