Commit Graph

6240 Commits

Author SHA1 Message Date
edX requirements bot
bb20b17428 Python Requirements Update (#29516)
* chore: Updating Python Requirements

* fix: fix pylint issues

Co-authored-by: Mohammad Ahtasham ul Hassan <mohammad.ahtasham@arbisoft.com>
2021-12-08 14:13:27 +05:00
Uzair Rasheed
971dc175f6 Merge pull request #29522 from edx/add-prop-to-mark-users
refactor: add a property to distinguish old and new users
2021-12-08 01:42:29 +05:00
Mohammad Ahtasham ul Hassan
8320dcb0e8 build: update stylint and eslint thresholds (#29471)
* build: update stylint and eslint thresholds

* Removed stylint threshold

* Update test_stylelint.py

* fix: fix eslint issues
2021-12-07 20:09:13 +05:00
uzairr
443034ed55 refactor: add a property to distinguish old and new users
Add a new prop in existing props to differentiate users either
a particular one is newly registered or not.

VAN-665
2021-12-07 17:59:31 +05:00
Zainab Amir
acf5add774 feat: add marketing email option on registration (#29397) 2021-12-07 17:16:28 +05:00
Kshitij Sobti
9f4bc9900b feat: add discussions context to course blocks API (#29300)
Add a new course blocks transformer that adds discussion context for units.
2021-12-07 11:10:48 +05:00
Dillon Dumesnil
f1cc288189 Merge pull request #29510 from edx/ddumesnil/override-freq-cap-aa-1127
feat: AA-1127: Overrides Braze Frequency Cap for dynamic pacing emails
2021-12-06 07:44:55 -08:00
Dillon Dumesnil
709290544d feat: AA-1127: Overrides Braze Frequency Cap for dynamic pacing emails
edx-ace version 1.4.1 introduces the ability to override braze
email frequency caps.
2021-12-06 07:56:28 -07:00
Jawayria
87c2a59d2b Merge pull request #29439 from edx/jawayria/bom-2606-39
chore: Applied lint-amnesty on openedx/features
2021-12-06 17:23:30 +05:00
Jawayria
a1c4b82cd5 Merge pull request #29435 from edx/jawayria/bom-2606-31
chore: Applied lint-amnesty on openedx/core/djangoapps
2021-12-06 15:23:46 +05:00
Jawayria
86d7cce373 Merge pull request #29436 from edx/jawayria/bom-2606-30
chore: Applied lint-amnesty on openedx/core/djangoapps/content
2021-12-06 15:23:25 +05:00
Jawayria
9cd4f96955 Merge pull request #29437 from edx/jawayria/bom-2606-29
chore: Applied lint-amnesty on openedx/core/djangoapps
2021-12-06 15:23:13 +05:00
Jawayria
61f3ef0724 chore: Applied lint-amnesty on openedx/core/djangoapps 2021-12-06 14:06:57 +05:00
Jawayria
959b6cef6c chore: Applied lint-amnesty on openedx/core/djangoapps/content 2021-12-06 14:06:13 +05:00
Jawayria
3adfe1de97 chore: Applied lint-amnesty on openedx/core/djangoapps 2021-12-06 14:05:13 +05:00
Jawayria
4347c35072 chore: Applied lint-amnesty on openedx/tests 2021-12-06 14:01:53 +05:00
Jawayria
328c181a38 chore: Applied lint-amnesty on openedx/features 2021-12-06 13:58:45 +05:00
Shafqat Farhan
84cba23c0b feat: VAN-666 - Reject new password that is detected as vulnerable on password reset 2021-12-03 19:19:21 +05:00
Régis Behmo
13342835b0 feat: theme-agnostic view to fetch theme assets (#29461)
It is possible to set custom logos in microfrontends, for instance with the
LOGO_URL setting. Ideally, we would like that MFEs share the same logos as the
LMS. But this is made difficult when comprehensive theming is enabled, and the
logo is overridden by a custom theme. In that scenario, the logo url becomes
/static/mytheme/images/logo.png. But the MFEs do no know that the "mytheme"
theme is enabled. To resolve this issue, we introduce here a view, at the
"/theming/asset/<path>" url, that redirects to the corresponding asset in the
theme that is currently enabled. Thus, MFEs only have to set
`LOGO_URL=http://lmshost/theming/asset/images/logo.png` to point to the themed
logo.

Related issue: https://github.com/overhangio/tutor-mfe/issues/25
2021-12-02 16:38:12 -05:00
Tim McCormack
02b9e059a2 feat: Remove monitoring for now-concluded verify-all work (#29495)
The removed attributes were needed in order to inform the move of the
`_verify_user` function call up out of the try/except block. That work has
concluded (https://github.com/edx/edx-platform/pull/29324) so the
monitoring can be removed.

Also:

- Bring a comment on some other monitoring up to date
- Make long-needed corrections to an existing docstring
- Remove malformed-cookie logging, since we haven't been using it
2021-12-02 18:45:48 +00:00
Usama Sadiq
780a6f3c2d Revert "chore: install codejail from pypi (#29481)" (#29501)
This reverts commit 21551095ac.
2021-12-02 22:19:15 +05:00
Jawayria
3a78775662 Merge pull request #29441 from edx/jawayria/bom-2606-37
chore: Applied lint-amnesty on openedx/core/lib
2021-12-02 19:13:06 +05:00
Jawayria
e83da77008 Merge pull request #29440 from edx/jawayria/bom-2606-40
chore: Applied lint-amnesty on openedx/features
2021-12-02 19:06:22 +05:00
Mohammad Ahtasham ul Hassan
21551095ac chore: install codejail from pypi (#29481)
* chore: install codejail from pypi

* chore: Updating Python Requirements

* chore: Updating Python Requirements

* fix: fixed failing tests

* fix: fixed pytest failures

* fix: fixed failing test bug

* Update mocks.py

Co-authored-by: edX requirements bot <testeng+edx-requirements-bot@edx.org>
2021-12-02 17:07:29 +05:00
Jawayria
dba7d78c74 chore: Applied lint-amnesty on openedx/core/lib 2021-12-02 15:11:13 +05:00
Jawayria
c227712f03 chore: Applied lint-amnesty on openedx/features 2021-12-02 15:02:24 +05:00
Tim McCormack
89699ed6a4 feat: Remove VERIFY_USER_CHANGE_UNCONDITIONAL toggle (now always enabled) (#29324)
We didn't see any errors after enabling this feature toggle, so remove it
in favor of the "True" setting.

Compare to PR #29306, which created the toggle.

ref: ARCHBOM-1952
2021-12-01 17:02:47 +00:00
Simon Chen
d1904bd99b fix: Ensure edX staff user can also see Honor Code modal dialog (#29479)
Co-authored-by: Simon Chen <schen@dhcp-10-31-112-124.dyn.mit.edu>
2021-12-01 10:13:27 -05:00
Syed Muhammad Dawoud Sheraz Ali
2325150cf8 feat: add referrer url when submitting Zendesk support ticket (#29474)
* feat: add referrer url as a custom field when submitting zendesk support ticket
2021-12-01 13:52:57 +05:00
Jawayria
2ce75cbfa7 chore: Applied lint-amnesty on openedx/core/djangoapps (#29442) 2021-11-30 15:08:25 +05:00
Jillian Vogel
ad5ad72273 [BD-13] Deprecate ModuleSystem.render_template (fixed) (#29354)
* refactor: deprecates ModuleSystem.render_template

in favor of the added MakoSystem render_template method.

Related changes:
* Adds the MakoService to the StudioEditModuleRuntime,
  PreviewModuleSystem, LmsModuleSystem, and XBlockRuntime
* MakoService constructor takes a `namespace_prefix` string, so that the
  CMS PreviewModuleSystem can render to LMS templates, without needing
  the special render_from_lms helper method.
* ModuleSystem.render_template becomes a read-only property, so the
  constructor calls and test module systems are updated accordingly.
* Adds tests for the MakoService and module system shims.

(cherry picked from commit 457f959356)

* refactor: use MakoService.render_template to remove deprecation warnings

from block code.

(cherry picked from commit 8d62d337f5)

* refactor: use MakoService.render_template to remove deprecation warnings

from test code.

(cherry picked from commit 26b43465a4)

* test: Adds a test to verify the bug introduced by the previous changes

The AuthoringMixin is automatically added to all XBlocks (see
settings.XBLOCK_MIXINS), and AuthoringMixin.visibility_view expects the
"mako" service.

This test verifies the bug by testing the PureXBlock, which does not
require the "mako" service, and so fails when the visibility_view is
rendered.

* fix: AuthoringMixin needs mako service

which fixes the visibility_view for XBlocks which don't explicitly
require the mako service.

Also removes the unneeded class property _services_requested from
AuthoringMixin and StudioEditableBlock. This property is better provided
by the XBlockMixin class.
2021-11-29 14:42:52 -05:00
Awais Jibran
72ec00cbb7 fix: include pii sharing values in the API (#29385) 2021-11-24 17:44:28 +05:00
Kshitij Sobti
c8bd924e23 feat: Add support for using the discussions MFE UI instead of existing UI [BD-38] [TNL-9228] (#29285)
* feat: Add support for using the discussions MFE UI instead of existing UI

Adds a new course waffle flag that when set along with the discussions MFE URL shows the discussions MFE UI instead of the regular UI.

* test: add tests

* squash!: more consistent url name
2021-11-23 14:56:25 +05:00
Tim McCormack
4efd2d161a fix: Correctly create origin from URL in CORS CSRF middleware (#29366)
Deleting all instances of the path from the URL meant that referers like
`https://learning.edx.org/` were turned into `https:learning.edx.org`. The
solution here is to use `urlunparse` to put the URL back together, but only
with the desired components (scheme and authority/netloc).

This relates to our previous upgrade to django-cors-headers 3.x, which
changed to use origins instead of domains in its whitelist setting:

36df86d829 (diff-811d60a3e1d60ff694eace0242e77d6b810d8e9c63c36d7b3c2591a08ebbb94bR58)

Added regression test (fails on master, passes on branch.)

Also:

- Replace word "domain" with "origin" in few places to use the correct
  term. (We should probably change this more broadly in names and comments
  in this module as some point.)
- Simplify logging to just output what we know, and not try to recapitulate
  the logic too much.

ref: BOM-2961
2021-11-22 17:49:57 +00:00
Uzair Rasheed
f74c0e51cb Merge pull request #29364 from edx/allow-login-if-email-opt-in-enabled
feat: allow login if email opt-in is enabled
2021-11-22 13:02:11 +05:00
Kshitij Sobti
e8e8f4acbe feat!: Change the way tabs are ordered [BD-38] [TNL-9174] [BB-5076] (#29262)
* feat!: Change the way tabs are ordered
The change imposes a new ordering for tabs based on their new priority. When reordering tabs, this ordering will be maintained.

* fix: Apply suggestions from code review

Co-authored-by: Farhaan Bukhsh <farhaan@opencraft.com>

* fix: review feedback

Co-authored-by: Farhaan Bukhsh <farhaan@opencraft.com>
2021-11-22 11:17:30 +05:00
uzairr
f02fe4c203 feat: allow login if email opt-in is enabled
allow login to in-active users if email opt-in is enabled

Fixes: VAN-768
2021-11-22 10:53:33 +05:00
Awais Jibran
5c2f8b23d4 fix: edx provider data in the api (#29331)
* fix: edx provider data in the api

* refactor: remove comments in the code

* test: update the test cases

* fix: quality changes
2021-11-19 18:58:28 +05:00
Adeel Ehsan
66654b2edb feat: don't allow account creation for secondary emails (#28880)
VAN-726
2021-11-19 17:06:24 +05:00
Justin Lapierre
f6f3a79a15 Revert "[BD-13] Deprecate ModuleSystem.render_template" 2021-11-16 15:16:08 -05:00
Kshitij Sobti
28a2af7a2a fix!: Removes the openedx provider temporarily [BD-38] [TNL-9269] (#29314)
* fix!: Removes the openedx provider temporarily

UI changes to support the new provider are in progress. Once they are ready we
can add back this provider.

* feat: add support for hiding providers from the API response
2021-11-15 21:06:16 +05:00
Matthew Piatetsky
22cb639919 feat: Update ace email header to match braze email header (#29310) 2021-11-15 10:44:41 -05:00
Tim McCormack
0bef57591d feat: Add feature toggle to allow broader safe-sessions user checking (#29306)
Contingent on new feature toggle `VERIFY_USER_CHANGE_UNCONDITIONAL`, check
for request/response user mismatches on all requests, not just those
setting a session cookie on the response.

This is intended to *restore* an older behavior. I believe that almost all
requests used to set a new session cookie, and for some reason no longer
do, so this is really just an attempt to return to that previous behavior
no matter whether a new session cookie will be set. (Previously, the
cookie-to-be-deleted check would still have been in effect, so this is
actually a slight change from the earlier behavior -- the logout response
will now be included, and then quickly ignored due to a later check.)

The off-by-default switch moves several lines of code out of a try block,
but also out from under an if guard that checks for certain cookie
conditions. The movement out of the try block should be irrelevant, since
neither of the relocated lines should be raising a SafeCookieError.
However, there is some chance that they could raise other exceptions when
called from their new location (and new situations), hence the use of a
feature toggle -- we'll want to make it easy to switch the new behavior off
quickly if we start seeing an increase in errors.

Once the change is well-exercised, we can remove the toggle and the old
call locations.

I'm not entirely sure about the change to the `verify_error` utility
function in the unit tests, but it seems like even unauthenticated requests
in Django end up with a user and session on the request object, so this is
probably a close-enough way to mock that out.

I duplicated a couple of tests to test with feature toggle on/off.

ref: ARCHBOM-1952
2021-11-15 15:28:59 +00:00
Waheed Ahmed
29608af616 fix: user info cookie (#29313)
This PR is an update on https://github.com/edx/edx-platform/pull/29280
2021-11-15 12:56:47 +05:00
Gábor Boros
230795fb07 feat: add optional-exposed extra field type to registration form
This defines optional extra fields that are not hidden under the toggle on the 
registration page.
2021-11-12 15:24:59 +01:00
Kshitij Sobti
285e2c4f29 feat: Adds a new discussion topic configuration mechanism [BD-38] [TNL-8623] [BB-4968] (#29082)
* feat: Adds a new discussion topic configuration mechanism

The new discussion configuration system links discussion topics directly to the course structure. This change adds a new task that sends a discussion update signal if there are any changes to the course. This signal includes all the context needed to update the configuration of the course.

The handler for this new event will create a new entry for each unit that needs a topic in the database. In the future this will be used to see the topics in the course.

* fix: add support for marking a provider as supporting LTI

* fix: review feedback
2021-11-12 19:08:43 +05:00
Waheed Ahmed
6ffdeab974 fix: remove hardcoded edx user info cookie name (#29280)
Removed hardcoded edx user info cookie name and used settings variable.
2021-11-12 11:33:00 +05:00
Matthew Piatetsky
5dbfae83fc fix: Miscellaneous styling fixes for mobile (#29294)
* fix: Miscellaneous styling fixes for mobile

* fix: Add px fallback since outlook doesn't support rem
2021-11-10 16:47:55 -05:00
Ned Batchelder
d9dd10dc97 style: code cleanups from Steven Burch (#29292)
* chore: update deprecated import from collections

* chore: remove outdated imports from markdown library

as it hasn't been supported since 2.0.3 and we're on 3.x.
This was deprecated at least as early as 2012!

* docs: add docstring and remove lint-amnesty to markdown plugin

* chore: remove deprecated etree import

* style: remove unnecessary-comprehension for sets

* style: resolve a number of amnestied pylint complaints

Co-authored-by: stvn <stvn@mit.edu>
2021-11-10 07:11:57 -08:00
Mehak Nasir
f0b9fde997 fix: ed-discussion configuration message added (#29295) 2021-11-10 19:35:26 +05:00