Commit Graph

5591 Commits

Author SHA1 Message Date
Michael Terry
5d9e7e9fe5 fix: don't count hierarchy blocks as complete for assignments
When considering whether a subsection is complete as an assignment,
skip any "hierarchy" types (sequential, vertical, etc) that don't
have children. If the user can't see the content, don't risk
marking it as complete.

AA-726
2021-03-29 16:06:11 -04:00
Thomas Tracy
9f4e51a241 feat: Add command to generate credentials config (#27088)
Adds a command to create an API connection to credentials for testing
program certificates on devstack. This command is not meant to be ran
manually, and will be included in a provisioning type script that will
be added later.
2021-03-29 10:04:59 -04:00
Feanil Patel
c1bdf01876 fix: Don't make request change logging a waffle flag.
Waffle flags are useful for gradual rollout but that's not possible this
high in the middleware because a lot of the data needed (request.user)
to partition incoming requests is not availabale this high in the
middleware.

Convert this to a WaffleSwitch which will be safer to operate.

Also increase the number of frames in the stack to print per change.
Printing just 1 did not provide enough info because DRF requests wrap
WSGI requests and have a setter proxy.  It will be useful to figure out
how they do this in case it's better that what we're doing in the safe
sessions middleware.

Ticket: https://openedx.atlassian.net/browse/ARCHBOM-1718
2021-03-26 14:38:35 -04:00
Feanil Patel
68bd33f310 Merge pull request #27138 from edx/feanil/add_request_user_change_logging
feat: Add more detailed request user change logging.
2021-03-25 14:01:52 -04:00
Feanil Patel
c2eabf6cca test: Update query counts.
The new WaffleFlag.is_enabled check in middleware increased query counts
for multiple tests.
2021-03-25 12:14:53 -04:00
Feanil Patel
0714ac5f0e feat: Add more detailed request user change logging.
The change is behind a WafleFlag and can be turned on to log every time
the `user` attribute of an instrumented request changes.  This will
significantly increase log volume so it shouldn't be left on all the
time but can be turned on to quickly debug issues related to sessions.

Ticket: https://openedx.atlassian.net/browse/ARCHBOM-1718
2021-03-25 12:14:53 -04:00
Shimul Chowdhury
eba710ccb5 feat: added batch_get_or_create class method for ExternalId (#25844)
* Added batch_get_or_create_user_ids method for ExternalId Model

Update doc string

* Update docstring & fix bug on test

[BD-24] [BB-2726] [TNL-7330]
2021-03-25 12:09:32 -04:00
Waheed Ahmed
b200699fc6 Keep user on FE if there is a running pipeline for SAML IDPs.
For some SAML providers, learners are redirected to MFE and breaking
the flow. Check for running pipeline and if the provider is a SAML
provider keep them on FE.

VAN-425
2021-03-25 18:43:19 +05:00
Zainab Amir
8cc5f13daf Add rate limit to registration endpoint (#27060)
Currently the registration endpoint has no rate limit. Added a new ratelimit
variable to support the change, it's value is set to 60/7d.

VAN-302
2021-03-25 16:28:30 +05:00
Waheed Ahmed
e3406257fe Fix edxloggedin cookie not present issue.
If edxloggedin cookie is not present but the user is authenticated;
user is redirected to authn MFE and then back to dashboard instead
of the desired redirect URL (e.g. finish_auth) resulting in learners
not enrolling into the courses.

VAN-415
2021-03-24 16:26:31 +05:00
Robert Raposa
650b0c1360 Merge pull request #27118 from regisb/regisb/fix-toggle-state-report-typeerror
[BD-21] fix: TypeError in toggle state report view
2021-03-23 17:32:30 -04:00
Régis Behmo
dae4403ba7 fix: TypeError in toggle state report view
We were attempting to add course overrides twice to objects returned in
the toggle state report view. This was causing a TypeError (and thus a
500 error) because the second time, we were attempting to add entries to
an incorrect object.

This issue was not caught by unit tests because we were not testing the
view with WaffleFlagCourseOverride objects. This commit adds a unit test
to prevent future errors.

This is another fix for PR #27108.
2021-03-23 20:33:48 +01:00
David Joy
8c6a06cf5b fix: adjust discussions app APIs to match consuming frontend (#27085)
This commit adjusts a few values in our discussions configuration APIs to make them match what the frontend needs, as well as to more accurately reflect the providers available today.

- The `active` provider ID is expressed as None if it doesn’t exist
- The “cs_comments_service” provider has been renamed “legacy” - when we implement the new discussions micro-frontend, we’ll also have a separate provider for that, so they can’t both be “cs_comments_service”.  Also, cs_comments_service is such a bad name for anything.
- The hard-coded providers list in get_supported_providers now includes ‘legacy’ and ‘piazza’, our two known providers.  This list will be updated as more known providers come online.
- The PROVIDER_FEATURE_MAP has similarly been updated.

Part of this task: TNL-8093
2021-03-23 13:37:16 -04:00
Robert Raposa
cbc803cd15 feat!: remove old waffle classes (#27069)
BREAKING CHANGE: Remove WaffleSwitchNamespace, WaffleSwitch, WaffleFlagNamespace,
and WaffleFlag from waffle_utils, in favor of the Legecy* classes
in edx-toggles. Although this is a breaking change, we have
preemptively removed all known uses.

BD-21
2021-03-23 09:37:48 -04:00
Feanil Patel
c67c401f89 temp: remove false positives on safe sessions middleware (#27105)
* temp: remove false positives on safe sessions middleware

This is a temporary fix to deal with false positives in the system due
to the masquerading feature.  Long term we may not want to rely on
knowing about how masquerding works in the safe sessions middleware and
instead manage masquerding of the requset user in some other way.

Co-authored-by: Robert Raposa <rraposa@edx.org>
2021-03-22 14:44:52 -04:00
Calen Pennington
91b74b7fd3 Merge pull request #23457 from open-craft/agrendalath/bb-2063-fix-marking-blocks-as-completed-on-course-outline-page-upstream
[BB-2063] Calculate completion for custom blocks on the Course Outline page
2021-03-22 13:33:18 -04:00
Agrendalath
e571693455 Support EXCLUDED blocks in Block Completion Transformer
For now only the discussion blocks were supported. If we had a custom XBlock that specified `completion_mode = XBlockCompletionMode.EXCLUDED`, then it could never be marked as completed on the course outline page, despite being marked as such inside the learning sequence.
2021-03-22 16:21:43 +01:00
Agrendalath
5a27b5df39 Calculate completion for custom blocks on the Course Outline page
This adds support for displaying completion on the course outline page, to remove the discrepancies between this view and the learning sequence. It also simplifies course outline page by reusing existing APIs for determining completion state and finding the "Resume block"'s target.
2021-03-22 16:21:32 +01:00
Robert Raposa
f9c11f061f Merge pull request #27059 from open-craft/nizar/update_block_structure_toggles_annotations
docs: updates ticket links for block structure settings and toggles
2021-03-22 09:29:48 -04:00
M. Zulqarnain
91d33611b1 refactor: pyupgrade in profile_images, programs, safe_sessions (#26953) 2021-03-22 17:51:13 +05:00
Robert Raposa
1c19fbf3b3 Merge pull request #26325 from regisb/regisb/migrate-toggle-state-report
[BD-21] Migrate toggle state report to edx-toggles
2021-03-22 08:27:49 -04:00
Usama Sadiq
aa618c460c refactor: remove unused-imports (#27083) 2021-03-19 22:42:14 +05:00
Régis Behmo
78c152975b refactor: migrate toggle state report to edx_toggles
The toggle state report could not be shared with other IDAs. Here we make use
of the newly available report from edx_toggles, and customize it to add data
from WaffleFlagCourseOverrideModel.
2021-03-19 17:14:14 +01:00
Régis Behmo
ae7d4994bf fix: deprecated waffle switch usage in test method 2021-03-19 17:08:57 +01:00
Sarina Canelake
2342f04447 Merge pull request #26435 from open-craft/shimulch/bb-3624-upstream
Fix missing email context values and pass site configuration to better multi-site customization
2021-03-19 08:42:38 -04:00
Awais Qureshi
05a5f5954b refactor: remove unused imports. 2021-03-19 10:15:59 +00:00
Shimul Chowdhury
e942f12adc Add missing context platform_name and contact_mailing_address. And pass
site configuration to email context.
2021-03-19 10:05:49 +06:00
Feanil Patel
1d99bb2eb3 Merge pull request #27062 from edx/feanil/more_logging
fix: Add more info in warning log messages.
2021-03-18 12:33:44 -04:00
Feanil Patel
416407fd73 fix: Add more info in warning log messages.
If this happens, it's usefule to know what main view code was being
targetd so that we can more easily investigate what might have caused
this issue.

Add a new custom attribute 'safe_sessions.user_mismatch' to find
requests that had this issue in our monitoring system.
2021-03-18 11:33:08 -04:00
Robert Raposa
d4bbd9d03e fix: move ignored error message custom attribute (#27047)
The `error_expected` custom attribute used to contain
both the class name and the error message. This had
the following issues:

* Combining data in the same custom attribute limits
the ability to query.
* The additional error class and message data is only
needed for ignored errors, since this data isn't
available elsewhere.

The following changes were made:
* `error_expected` will always have the value True
if present.
* `error_ignored` no longer exists.
* `error_ignored_class` will contain the error module
and class for ignored errors.
* `error_ignored_message` will contain the error message
for ignored errors.

ARCHBOM-1708
2021-03-18 10:37:47 -04:00
Waheed Ahmed
4af767e0fb Fix finish auth url for MFE
Currently extra query params are not being handled in get TPAContextView,
Fixed using already available get_next_url_for_login_page().

VAN-415
2021-03-18 19:19:14 +05:00
Usama Sadiq
afc0a6b770 refactor: Ran pyupgrade on openedx/core/djangoapps/enrollments (#26912)
Co-authored-by: Muhammad Soban Javed <58461728+iamsobanjaved@users.noreply.github.com>

Co-authored-by: Muhammad Soban Javed <58461728+iamsobanjaved@users.noreply.github.com>
2021-03-18 18:38:20 +05:00
Usama Sadiq
918c44e499 refactor: Ran pyupgrade on openedx/core/djangoapps/embargo (#26911) 2021-03-18 18:38:09 +05:00
Usama Sadiq
8ca33082ff refactor: Ran pyupgrade on openedx/core/djangoapps/django_comment_common (#26910) 2021-03-18 18:37:59 +05:00
Usama Sadiq
5b9978029e refactor: ran pyupgrade on openedx/core/djangoapps (#26909)
Ran pyupgrade on {debug, demographics, discussions}.
2021-03-18 18:37:31 +05:00
Nizar Mahmoud
5f7dbc2d45 docs: updates ticket annotations for block structure settings and toggles
Updates the annotations for the block structure settings and toggles based on a [discussion] that was held on the pull request that annotated those same settings and toggles.

It also adds the DEPR tickets that were promised earlier in the annotations.
For future reference, there's also a [forum thread] to discuss the DEPR tickets titled.

[discussion]: https://github.com/edx/edx-platform/pull/26175#issuecomment-800632485

[forum thread]: https://discuss.openedx.org/t/deprecation-removal-several-block-structure-caching-settings-depr-143-depr-144-depr-145-depr-146/4288?u=nizar
2021-03-18 13:05:32 +03:00
Zainab Amir
3cdbb5b36a Track total time it takes users to register (#27020)
Added a new property in edx.bi.user.account.registered event to
track total time it took the user to register.

VAN-413
2021-03-18 13:02:12 +05:00
Awais Qureshi
a872383a70 Merge pull request #26939 from edx/content_type_gating-2
pyupgrade in content-type-gating
2021-03-17 17:33:21 +05:00
M. Zulqarnain
5d2b0e8346 refactor: pyupgrade in content_libraries and contentserver apps (#26892) 2021-03-17 17:28:23 +05:00
M. Zulqarnain
6266caf143 refactor: pyupgrade in openedx/content app (#26891) 2021-03-17 17:28:06 +05:00
M. Zulqarnain
0d86ebb361 refactor: pyupgrade in openedx/content app (#26890) 2021-03-17 17:27:48 +05:00
Jawayria
b578dba357 Merge pull request #26599 from edx/jawayria/bom-2408-2
BOM-2408: Removed unused imports from openedx/core/djangoapps/content
2021-03-17 16:54:20 +05:00
Awais Qureshi
6214f2deca Merge pull request #26940 from edx/course-bookmarks
pyupgrade in course-bookmarks, course-duration
2021-03-17 16:45:58 +05:00
Robert Raposa
2c0a8242f7 ARCHBOM-1708: feat: monitor and log expected errors (#26980)
Adds logging and monitoring capabilities for expected
errors. See the ADR and how-to  documentation for
details of how to configure and use the EXPECTED_ERRORS
setting and new monitoring and logging.

ARCHBOM-1708

Co-authored-by: Tim McCormack <tmccormack@edx.org>
2021-03-17 07:27:13 -04:00
Matt Tuchfarber
698de6d0fb Merge pull request #27030 from edx/tuchfarber/remove_cert_date_waffle
Enable course cert sync for all courses
2021-03-16 15:18:10 -04:00
Matt Tuchfarber
ed8604534c (feat) Enable course cert sync for all courses
Removes waffle flag restriction for syncing certificate available dates
to the credentials service.
2021-03-16 14:31:11 -04:00
Stu Young
5107aa41e9 DENG-803: add traits to segment context for enrollment activated events (#26842)
add traits to segment context for enrollment activated events
2021-03-16 14:28:22 -04:00
David Ormsbee
82ca05392e fix: Fix proctored exam display in learning_sequences admin.
I had the wrong attribute before this commit, and Django Admin let
me get away with it because it doesn't explode when you try to grab
relations that aren't there–it just quietly returns None in some of
those cases.
2021-03-16 09:50:28 -04:00
Awais Qureshi
2e9bb7b961 Merge pull request #26954 from edx/learner-profile
pyupgrade in leaner-profile, lti-course-tab, personalized-learner
2021-03-16 17:33:17 +05:00
Matt Tuchfarber
30d59f2fcc Merge pull request #26991 from edx/tuchfarber/fix_transaction_bug
feat: Pass date in cert date update signal
2021-03-16 08:01:27 -04:00