Commit Graph

79 Commits

Author SHA1 Message Date
Christie Rice
3d20c848f8 style: Use constants for certificate status. Update certificate status and grade documentation. (#27250)
MICROBA-1074
2021-04-07 09:38:56 -04:00
Usama Sadiq
bd9bb424cd refactor: ran pyupgrade on lms/djangoapps/certificates (#26740) 2021-03-12 14:47:30 +05:00
Justin Hynes
32685a7999 MICROBA-1025 | Update cert_whitelist.py management command
[MICROBA-1025]
- Update management command to use the same logic that the Instructor Dashboard uses
- Fix bug in management command where processing stopped when encountering a user that did not exist
- Add more logging
- Add and update tests where needed
2021-03-09 14:45:44 -05:00
Justin Hynes
05c82810e0 MB-1023 | Fix defect when removing allowlist entry on instructor dashboard
[MB-1023]
- Fix issue from recent refactor. Verify certificate is not none before attempting to invalidate the certificate.
- Add more logging
2021-03-03 13:14:01 -05:00
Justin Hynes
07837cf54e MICROBA-1024 | Move the allowlist and blocklist checks to certificates app
[MICROBA-1024]
- Move some of the recently added logic from the instructor app to the certificates app
- Attempt to not use other certificate models directly in the code I am touching, moving this logic to certificates as well.
2021-03-02 14:58:20 -05:00
Christie Rice
57f9005e57 MICROBA-918 Add allowlist check (#26584) 2021-02-24 09:07:04 -05:00
Aarif
a332aac1f6 replaced unittest assertions pytest assertions (#26541) 2021-02-19 12:27:11 +05:00
Christie Rice
367d2a07c9 Fix lint-amnesty warnings (#26411) 2021-02-08 10:49:32 -05:00
Christie Rice
6e5a9f5f6f MICROBA-918 Move methods to separate certificate generation from celery task to schedule certificate generation. Also standardizes imports. (#26410) 2021-02-08 10:01:04 -05:00
Jawayria
92a13c55c3 Applied pylint-amnesty to certificates 2021-02-02 19:23:48 +05:00
Christie Rice
b1e5695acf MICROBA-921 Move emit_certificate_event() to utils (#26133) 2021-01-26 14:41:34 -05:00
Christie Rice
8888f27d29 MICROBA-921 Fix typos (#26132)
* MICROBA-921 fix typos

* Fix quality
2021-01-25 15:05:22 -05:00
Kyle McCormick
151bd13666 Use full names for common.djangoapps imports; warn when using old style (#25477)
* Generate common/djangoapps import shims for LMS
* Generate common/djangoapps import shims for Studio
* Stop appending project root to sys.path
* Stop appending common/djangoapps to sys.path
* Import from common.djangoapps.course_action_state instead of course_action_state
* Import from common.djangoapps.course_modes instead of course_modes
* Import from common.djangoapps.database_fixups instead of database_fixups
* Import from common.djangoapps.edxmako instead of edxmako
* Import from common.djangoapps.entitlements instead of entitlements
* Import from common.djangoapps.pipline_mako instead of pipeline_mako
* Import from common.djangoapps.static_replace instead of static_replace
* Import from common.djangoapps.student instead of student
* Import from common.djangoapps.terrain instead of terrain
* Import from common.djangoapps.third_party_auth instead of third_party_auth
* Import from common.djangoapps.track instead of track
* Import from common.djangoapps.util instead of util
* Import from common.djangoapps.xblock_django instead of xblock_django
* Add empty common/djangoapps/__init__.py to fix pytest collection
* Fix pylint formatting violations
* Exclude import_shims/ directory tree from linting
2020-11-10 07:02:01 -05:00
Dillon Dumesnil
a96079f2d1 AA-196: Course Celebration for passing Verified Learners 2020-10-01 16:53:25 -04:00
uzairr
fb9ba90efe PROD-1236: Do not expose user id with certificate URL. 2020-07-17 22:59:34 +05:00
Kyle McCormick
ec9ac34886 Paginate course card API for Programs Learner Portal
* Pull business logic of ProgramCourseEnrollmentOverviewView
  out of view class and into utils.py.
* Add UserProgramCourseEnrollmentsView, which is a paginated
  version of ProgramCourseEnrollmentOverviewView with a
  URL that is parameterized on the user (to enable masquerading
  in MST-109).
* Add get_certificates_for_user_by_course_keys to certs API
  to make enrollments overviews REST API use fewer SQL queries.
* Document new course cards API with edx-api-doc-tools.

In a follow-up ticket, the Programs Learner Portal will switch
to the new paginatd API in order to speed up its page load.

MST-126
2020-05-04 09:26:23 -04:00
Aarif
6ee2089077 fixed warnings for wrong-import-order 2020-04-08 23:43:06 +05:00
Diana Huang
99863aebff Remove course_id field from CourseMode.
Handle this change appropriately in CourseModeFactory.
2020-04-06 11:21:28 -04:00
Waheed Ahmed
442da4a7fe Don't show certificate on profile if no active config.
Stop showing certificate information on profile page if there is no
active certificate configuration.

PROD-1200
2020-01-28 22:30:16 +05:00
Feanil Patel
9cf2f9f298 Run 2to3 -f future . -w
This will remove imports from __future__ that are no longer needed.

https://docs.python.org/3.5/library/2to3.html#2to3fixer-future
2019-12-30 10:35:30 -05:00
Ned Batchelder
efba6e45e8 Finally import courseware properly everywhere to get rid of a warning 2019-09-26 09:40:15 -04:00
Ayub khan
8a95a8e520 BOM-95
assertItemsEqual with six.assertCountEqual
2019-08-21 17:01:40 +05:00
usama sadiq
eef3b65535 Python3 Update
Added future absolute_import
Changed unicode() with six.text_type()
2019-07-08 19:41:58 +05:00
Nimisha Asthagiri
aee2d36580 Remove microsites from certificates
DEPR-26
2019-05-29 03:15:53 -04:00
Michael Youngstrom
3221c2b91f Remove lms pytest shards 2019-02-12 11:03:46 -05:00
Giovanni Cimolin da Silva
8563cf437a Fix certificate api when retrieving certificates from deleted courses
This commit fixes a problem with the Certificates API that make it fail when trying to retrieve user certificates from courses that don't exist anymore.
The problem lies in the Certificate API not checking if the courses being retrieved by some user actually exist, to fix this, this commit improves the fault tolerance of the Certificates API.

This issue was found when investigating why a user profile page (/u/username) was returning 404's.
Turns out that LearnerAchievementsFragmentView used the certificates api to retrieve certificate information, which did not check if the course exists before trying to pull information from it, resulting in a cascade of errors that lead to a 404 on the user's profile page.

Signed-off-by: Giovanni Cimolin da Silva <giovannicimolin@gmail.com>
2019-01-11 11:40:00 -02:00
Jeremy Bowman
f1668c3e55 TE-2790 Fix microsite config leak in tests 2018-10-22 14:48:28 -04:00
Jeremy Bowman
ca3316962d TE-2524 Stop using nose.plugins - LMS 1 2018-07-31 13:03:18 -04:00
Waheed Ahmed
c2ad6f4002 Revert "Fix PDF cert gereration/regeneration and URLs." 2018-07-26 18:20:27 +05:00
Waheed Ahmed
23d1beedf7 Merge pull request #18285 from edx/waheed/LEARNER-4520-fix-pdf-certificates
Fix PDF cert gereration/regeneration and URLs.
2018-06-06 15:36:52 +05:00
Eric Fischer
247bb50ed2 s/django.core.urlresolvers/django.urls/g
Django 1.10 deprecation fix for Hackathon XIX
Addresses PLAT-1397
2018-06-05 13:59:09 -04:00
Waheed Ahmed
baf3e594be Fix PDF cert gereration/regeneration and URLs.
Since cert_html_view_enabled is deprecated and set default true,
PDF certificates are not appearing for learners and staff also
unable to regenerate them.

LEARNER-4520
2018-05-31 15:45:31 +05:00
Nimisha Asthagiri
dd20106c8b Quiet quality 2018-01-19 15:12:29 -05:00
Nimisha Asthagiri
2e9efe6472 Fix Certificates import and signals code 2018-01-19 15:12:28 -05:00
Jeremy Bowman
ca97e946a6 Switch to pytest for unit tests 2017-09-22 16:07:53 -04:00
Gregory Martin
c1dcb54a66 Update 'downloadable' status for mobile/other API 2017-09-07 14:25:01 -04:00
Gregory Martin
b19d80597c Update Task 2017-08-22 09:57:29 -04:00
Sofiya Semenova
76f1df6b0e EDUCATOR-526 Update view cert button to only appear after availability
date has passed
2017-08-15 11:57:28 -07:00
Andy Armstrong
79acb5c5be Reorder LMS imports using isort 2017-06-11 21:48:06 -04:00
Andy Armstrong
480cf57026 Improve test failure message 2017-05-05 15:12:21 -04:00
Diana Huang
e12a704cea Add new course dates fragment.
Also add it to the course home page.
2017-05-04 20:53:42 -04:00
Ned Batchelder
4a568476fd Remove a number of unneeded super()-delegation methods 2017-04-27 14:12:56 -04:00
Jillian Vogel
a5ba476935 Ensures that the following GeneratedCertificate fields are passed
through to the REST API:

* created_date: date/time the certificate was issued.
* is_passing: boolean flag denoting whether the certificate status is
  passing or non-passing.

And adds JwtAuthentication, so the Certificates REST API can be easily
accessed from Enterprise management commands.
2017-03-24 17:51:42 +10:30
David Ormsbee
2051c90924 Test Speedup: Isolate Modulestore Signals
There are a number of Django Signals that are on the modulestore's
SignalHandler class, such as SignalHandler.course_published. These
signals can trigger very expensive processes to occur, such as course
overview or block structures generation. Most of the time, the test
author doesn't care about these side-effects.

This commit does a few things:

* Converts the signals on SignalHandler to be instances of a new
  SwitchedSignal class, that allows signal sending to be disabled.

* Creates a SignalIsolationMixin helper similar in spirit to the
  CacheIsolationMixin, and adds it to the ModuleStoreIsolationMixin
  (and thus to ModuleStoreTestCase and SharedModuleStoreTestCase).

* Converts our various tests to use this new mechanism. In some cases,
  this means adjusting query counts downwards because they no longer
  have to account for publishing listener actions.

Modulestore generated signals are now muted by default during test runs.
Calls to send() them will result in no-ops. You can choose to enable
specific signals for a given subclass of ModuleStoreTestCase or
SharedModuleStoreTestCase by specifying an ENABLED_SIGNALS class
attribute, like the following example:

    from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase

    class MyPublishTestCase(ModuleStoreTestCase):
        ENABLED_SIGNALS = ['course_published', 'pre_publish']

You should take great care when disabling signals outside of a
ModuleStoreTestCase or SharedModuleStoreTestCase, since they can leak
out into other tests. Be sure to always clean up, and never disable
signals outside of testing. Because signals are essentially process
globals, it can have a lot of unpleasant side-effects if we start
mucking around with them during live requests.

Overall, this change has cut the total test execution time for
edx-platform by a bit over a third, though we still spend a lot in
pre-test setup during our test builds.

[PERF-413]
2017-02-23 10:31:16 -05:00
Simon Chen
6dbfb3261e Support the display of downloadable PDF course certs ECOM-5790 2016-12-08 16:52:36 -05:00
Calen Pennington
bc20a37c2b Simplify how shards are selected in CI 2016-08-03 16:23:02 -04:00
Saleem Latif
8ae92901ef 1. Merge microsites into Comprehensive Theming
2. Add site configuration overrides to theming/helpers.py
3. Move microsite.get_value from theming/helpers to site_configuration/helpers
4. Move microsite_configuration.microsite.get_value usages to site_configuration.helpers.values
2016-07-27 13:55:14 +05:00
Nimisha Asthagiri
1ada5c3487 Create Grades djangoapp
https://openedx.atlassian.net/browse/TNL-5008
2016-07-22 00:09:43 -04:00
Syed Hasan raza
01c8b3499c Merge pull request #12790 from edx/shr/bug/ECOM-4645-Certificate-exception-whitelisted-users
exception_handling_for_unverified_cert_status
2016-06-22 15:46:49 +05:00
Syed Hassan Raza
5f7cdcd30a exception_handling_for_unverified_cert_status 2016-06-22 13:33:40 +05:00