Commit Graph

167 Commits

Author SHA1 Message Date
Matt Tuchfarber
63cb6a97ff Revert "feat: Reimagine certificate_availability_date and certificates_display_behavior" 2021-07-07 16:53:05 -04:00
Matt Tuchfarber
2a7106acfb 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 to validate these fields and choose sane
defaults if they aren't expected values

Certificates will now show under the following circumstances:
"Immediately upon passing"
certificate_availability_date = null
certificates_display_behavior = "early_no_info"

"End date of course"
certificate_availability_date = null
certificates_display_behavior = "end"

"A date after the course end date"
certificate_availability_date = <date>
certificates_display_behavior = "end_with_date"
2021-07-06 16:45:23 -04:00
Matt Hughes
8023a09191 fix: deleted courses do not break program details page
Sometimes learners have certificates in old course runs which've been
deleted. When this happens loading the learner's program progress can
result in 500 errors. This corrects those by choosing to count any
non-existent course the learner has certificates for as counting
towards program completion, effectively assuming that availability
dates have passed for all such courses.

Also fixes an error with a condition related to how we determine
whether an enrolled course is considered "in progress". The previous
version of the code had a bug that would result in a lot more courses
being marked "in progress" for the purpose of program completion than
actually were.

JIRA:EDUCATOR-5787
2021-06-09 10:58:00 -04:00
Thomas Tracy
84c953948b MB-1167: calling course certificates api from LMS (#27552)
* [feat] calling course certificates api from LMS

Now that CourseCertificates in credentials have a field for the
available_date, we need to make sure we are always updating that field
when it changes in studio. This PR adds a call to a new Credentials API
that will update the field each time the date change signal fires.
2021-05-12 15:42:08 -04:00
Usama Sadiq
4f4be6538a BOM-2477: pylint warnings lint-amnesty (#27585) 2021-05-11 17:22:40 +05:00
Albert (AJ) St. Aubin
ee71594714 refactor!: Remove backpopulate_program_credentials in favor of using
notify_credentials command

In this PR we are removing a management command that has performance issues and duplicates logic not available in the notify_credentials management command.
2021-05-05 12:22:38 -04:00
Justin Hynes
35cfca0be1 Merge pull request #27357 from edx/jhynes/microba-1164_revoke-program-certs-bugfix
fix: fix bug with `revoke_program_certificates` task
2021-04-22 07:38:32 -04:00
Albert (AJ) St. Aubin
a1fe3d58dc [bug] Corrected issue where program dash showed incorrect completed
count

[MICROBA-1163]

This change will correct an issue in the Program Dashboard where a user
would see a course as completed, but not see their Certificate because
it was not available to them yet.
2021-04-21 16:03:33 -04:00
Justin Hynes
a7bc9d1cc1 fix: fix bug with revoke_program_certificates task
[MICROBA-1164]
* cast `course_key` as a string when scheduling the `revoke_program_certificates` task
* Update existing unit tests
* Move test utility method in test_tasks.py out from the middle of the test cases
* Fix spelling in test function name
2021-04-21 14:43:03 -04:00
M. Zulqarnain
91d33611b1 refactor: pyupgrade in profile_images, programs, safe_sessions (#26953) 2021-03-22 17:51:13 +05:00
Régis Behmo
ae7d4994bf fix: deprecated waffle switch usage in test method 2021-03-19 17:08:57 +01: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
Matt Tuchfarber
a82489db8e fix tests 2021-03-12 14:59:44 -05:00
Matt Tuchfarber
6c97dfe1e5 Move cert date signals to avoid race conditions
COURSE_CERT_DATE_CHANGE was being called before saving the new data in
the course overview. The listeners were expecting to pull the data out
of the course overview, and thus were only right about half the time.
This moves the signal to trigger after the course publish signals are
handled.
2021-03-04 15:57:21 -05:00
Justin Hynes
03d788fc5b Log error when failing to award program certificate 2021-02-25 10:25:49 -05:00
Aarif
cfcb9330b3 replaced unittest assertions pytest assertions (#26568) 2021-02-22 12:24:33 +05:00
edX requirements bot
a2635e9821 Python Requirements Update (#26463)
* Updating Python Requirements

* change namespaced_switch_name to name

Co-authored-by: Zulqarnain <muhammad.zulqarnain@arbisoft.com>
2021-02-10 16:25:34 +05:00
Matt Tuchfarber
64032faae7 Make credentials celery tasks errors consistent
In order to better alert off of tasks that failed after maximum retries,
this makes the the error for each task consistent with itself.
2021-02-08 13:55:35 -05:00
M. Zulqarnain
e159ab8e4d Pylint amnesty in openedx plugin_api, profile_images and programs apps (#26377) 2021-02-04 17:10:38 +05:00
Christie Rice
b1e5695acf MICROBA-921 Move emit_certificate_event() to utils (#26133) 2021-01-26 14:41:34 -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
Albert (AJ) St. Aubin
8cef028429 Update the award_program_cert task to fix celery registration
[MICROBA-676]
2020-10-23 17:08:34 -04:00
Matt Tuchfarber
3cea568719 Fix variable reuse bug in program enrollment check
Reuse of the variable paid_modes was causing the code to follow an
incorrect path. Changed the filtering version of the variable to
paid_modes_only. Had to keep both variables temporarily until I can fix
plugin code that uses this API.
2020-09-09 14:05:48 -04:00
Matt Tuchfarber
c4cf0b9bb7 Refactor program type enrollment checks
Checking if a user was enrolled in a program type was using the `name`
field which is subject to be translated. This change allows for us to check by
the type's slug which will be constant. This also includes the addition
of api.py files for the course_modes, catalog, and programs apps.
2020-08-26 14:29:39 -04:00
Albert (AJ) St. Aubin
77f3d9099b [MICROBA-437] Add api to determine demographics status based on user data 2020-07-14 12:58:07 -04:00
SaadYousaf
52cfe647b3 syncing certificates on course update on credential side. 2020-06-16 11:58:49 +05:00
Calen Pennington
86e2677f26 Use a standard function to find out if a course has ended 2020-06-11 11:40:56 -04:00
Calen Pennington
1cf46e76d0 Don't compare None to a date when a course doesn't have an end date 2020-06-11 11:40:56 -04:00
Jansen Kantor
f4a2303013 EDUCATOR-5043: remove grades from program progress page (#23940)
* remove grades from program progress page
2020-05-08 14:46:20 -04:00
Robert Raposa
e63a7a4920 Revert "remove tests causing flakiness (#23827)" (#23830)
This reverts commit be1aaa00ff.
2020-04-28 17:31:45 -04:00
Robert Raposa
be1aaa00ff remove tests causing flakiness (#23827)
These removed tests can be restored once someone works out why they
were causing flakiness elsewhere and fix the problem.

Reverts tests added in:
dca50aacc3
2020-04-28 16:12:29 -04:00
Waheed Ahmed
dca50aacc3 added tests for revoke program cert task 2020-04-27 16:35:36 +05:00
Troy Sankey
d428f7530d Revert "Revert "Rename values in SiteConfiguration (2/3) attempt #2""
This reverts commit e6f58b6d4c.

This is our third (3rd!) attempt to deploy stage 2 of this column rename.
2020-03-04 14:53:47 -05:00
Troy Sankey
e6f58b6d4c Revert "Rename values in SiteConfiguration (2/3) attempt #2" 2020-02-27 13:24:55 -05:00
Troy Sankey
c422dec083 Revert "Revert "Rename values in SiteConfiguration (2/3)""
This reverts commit b85aa4b3fb.
2020-02-26 12:54:24 -05:00
Troy Sankey
b85aa4b3fb Revert "Rename values in SiteConfiguration (2/3)" 2020-02-26 11:23:56 -05:00
Julia Eskew
3541643dd5 Rename values in SiteConfiguration (2/3)
This stage does the following:

- Includes a data migration to copy the values from old to new field.
- Changes business logic to switch to using new field.
- Deletes all code references of the old field.
2020-02-25 13:54:02 -05:00
Troy Sankey
18deacde54 Revert "Revert "This stage does the following: (#22692)""
This reverts commit 84de6bc6de
which reverts commit cebeab4348
which implements the first stage of the `values` column rename in
SiteConfiguration.  However, I included a small change:

This time, we set a default value on the new `site_values` column so
that the ORM will happily deserialize the JSONField without throwing a
JSONDecodeError.
2020-02-19 12:01:57 -05:00
Julia Eskew
84de6bc6de Revert "This stage does the following: (#22692)"
This reverts commit cebeab4348.
2020-01-14 13:01:21 -05:00
Julia Eskew
cebeab4348 This stage does the following: (#22692)
- Adds the new field and migration to create the column.
- Makes all writes go to both old and new field.
2020-01-14 10:40:39 -05:00
Feanil Patel
6e3fe00fff Fix all E303 pep8 errors. 2019-12-30 12:25:38 -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
Jeremy Bowman
553d35e53e Upgrade mock BOM-596 (#21717) 2019-09-24 10:14:17 -04:00
Ayub khan
8a95a8e520 BOM-95
assertItemsEqual with six.assertCountEqual
2019-08-21 17:01:40 +05:00
Christie Rice
3d062aab62 REVMI-354 Add enroll_in_course permission (#21243)
* REVMI-354 Add enroll_in_course permission

* Fix test
2019-08-01 08:37:41 -04:00
Amit
fd7527e136 INCR-239 (#20510)
* INCR-239: Run python-modernize and isort on openedx/core/djangoapps/programs [tests, tasks]

* INCR-239: Grouped six package and represent unused variables with _
2019-05-10 12:35:41 -04:00
Zainab Amir
97e26785e3 Change attribute in ProgramDataExtender log warning
The variable course_run is not an attribute of object
ProgramDataExtender and should not be accessed using self.

LEARNER-6734
2019-04-10 12:11:31 +05:00
Jason Myatt
09d51b00b5 Filter out certificates for nonexistent courses
LEARNER-7086. Uses a new model manager for GeneratedCertificate that excludes
certificates whose course_id does not correspond to a valid CourseOverview
2019-03-08 11:28:41 -05:00
Michael Youngstrom
4bbd1dee0b Remove shards from commonlib-unit tests 2019-02-12 14:28:35 -05:00
Ned Batchelder
3353e7425e Remove unused imports 2018-11-03 16:07:05 -04:00