Commit Graph

124 Commits

Author SHA1 Message Date
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
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
Matt Tuchfarber
d16c9a804c refactor: Move cert code to cert app
The `may_certify` function is used to determine whether a learner should
be able to see that their certificate is ready. It is therefore entirely
in the certificates domain. This remove may_certifiy and
may_certify_for_course from the xmodule and course_overview
apps and into the certificates app. The xmodule may_certify was not called
outside of tests prior to this, and the other's were easily moved.

In order to avoid circular imports, this also moved
certificate_info_for_user out of the model code and into an API
2021-07-21 15:56:19 -04:00
Albert (AJ) St. Aubin
b23169560f fix: Corrects issue with refund logic and certificates.
[MICROBA-1307]

Before this change a user would not be auto refunded if they had a
certificate in a course with any status. This had unintended
consequences. This change updates the logic to only block auto refund
for statuses that we do not want to refund on such as downloadable.
2021-06-28 09:20:00 -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
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
M. Zulqarnain
91d33611b1 refactor: pyupgrade in profile_images, programs, safe_sessions (#26953) 2021-03-22 17:51:13 +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
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
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
f90bcabcd7 Add debugging for programs enrollment 2020-09-04 12:05:06 -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
Matt Tuchfarber
cbeab67833 Use demographics api for dashboard banner
Make demographics collection banner on dashboard use new demographics
API which checks enterprise as well. Also expose serialization of
CourseEnrollments.
2020-07-17 13:20:42 -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
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
Matthew Piatetsky
68777a270a Modify the program dashboard to make it pass the bundle parameter which is necessary to see the program discounted price
REV-1123
2020-04-02 11:34:02 -04: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
adeelehsan
c7172c1d69 Uri added for explore new program
PROD-1004
2019-11-26 17:28:45 +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
arbisoft
86a5066991 Fixing python-modernize issues. 2019-07-10 14:35:29 +05:00
Amit
087250cff7 INCR-250: Make compatible with Python 3.x without breaking Python 2.7… (#20534)
* INCR-250: Make compatible with Python 3.x without breaking Python 2.7 support --> openedx/core/djangoapps/programs

* INCR-250: Disable pylint warning and replace _f placeholder with actual name

* INCR-250: pylint format correction and fix over length line limit
2019-06-11 10:17:52 -04:00
Nimisha Asthagiri
eb0791ec89 Inter-app API cleanup for Grades 2019-05-04 11:35:06 -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
Emma Green
57b7150b09 add course to program caching 2019-02-22 13:18:23 -05:00
emma-green
cbf3f78325 Revert "WIP:Cache course runs to programs" 2019-02-20 12:03:07 -05:00
Emma Green
f2139bbe2f add courses to programs to cache 2019-02-19 15:17:23 -05:00
Matthew Piatetsky
f294b1a374 fix unicode strings in openedx/ part 1 2019-02-13 10:47:35 -05:00
Emma Green
ce7b094cfb don't error out to user programs with really old course runs not in lms 2018-10-19 13:25:28 -04:00
Michael Terry
c90edab169 Bundle an SQL query for performance
We were doing many individual SQL queries for certificates when
awarding program certs. It's possible this was contributing to
high SQL load. Instead, let's bundle those queries up into a larger
one.

LEARNER-6490
2018-10-05 12:43:47 -04:00
Diana Huang
755ebc8c7f Send program cert visible_date
When sending a program cert to Credentials, also send along a
calculated visible_date along with it.

LEARNER-6262
2018-09-04 16:05:24 -04:00
christopher lee
56f83b5704 Add switch to always calculate program price as anon user
LEARNER-5555
2018-06-18 12:33:40 -04: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
Michael Terry
27a2b8f676 Only get program certs from credentials
Allow our utility function to filter out course certs when asking
Credentials for a list of certificates. This way once we start
handing back course certs, the LMS won't be surprised by
assumptions about what the credentials service will give back.
2018-06-01 12:53:18 -04:00
Eric Fischer
e18448e27d Silence deprecation warnings
https://docs.djangoproject.com/en/1.11/releases/1.10/#using-user-is-authenticated-and-user-is-anonymous-as-methods
2018-05-02 10:03:50 -04:00
Albert St. Aubin
213673db61 Updates to use the is_anonymous flag of basket calculate
[LEARNER-4913]
2018-04-25 11:42:53 -04:00
Matt Tuchfarber
fce1699a55 Enables disabling of auth urls for program cert linkings.
WL credentials sites are not set up with site aware OAuth and therefore
require that
2018-03-20 16:03:47 -04:00
Ahsan Ulhaq
5a67f50174 Make sure user is login in credential when redirected from lms
LEARNER-3729
2018-02-23 13:15:02 +05:00
Waheed Ahmed
c68b50d964 Update program detail fragment.
LEARNER-3755
2018-01-17 13:48:33 +05:00
Albert St. Aubin
2e99ee0d7f Changes the Program Details page to show the most recently purchased
entitlement data

[LEARNER-3708]
2018-01-12 15:03:25 -05:00
Waheed Ahmed
2406812100 Update program detail fragment url for mobile apps.
LEARNER-3754
2018-01-10 19:01:04 +05:00
Harry Rein
b09f4fabf1 Show more sessions coming soon for entitlements without sessions. 2017-12-21 15:38:45 -05:00
Harry Rein
5e2c3e4bf5 Merge pull request #16933 from edx/HarryRein/LEARNER-3636-dont-show-expired-entitlements-unenrolled
Do not show expired, unfulfilled entitlements on dashboards.
2017-12-18 16:26:43 -05:00
Harry Rein
75aa736dcf Do not show expired, unfulfilled entitlements on course/programs dashboard.
LEARNER-3636
2017-12-18 15:16:35 -05:00
Michael Terry
4fe60eb1e4 Show programs for expired entitlements
The dashboard was not showing related programs for expired but
fulfilled entitlements.

LEARNER-3608
2017-12-18 14:41:20 -05:00
Michael Frey
3305a7c3ff Get only the first program from the list of matching entitlements.
LEARNER-3606
2017-12-17 17:32:52 -05:00
Matt Tuchfarber
a4f5c14cf9 Order program instructors based on new program field
This collects the instructors from the courses in the program like before. There is now a field in the program model in discovery that allows you to list instructors for the program.

Depends on this PR: https://github.com/edx/course-discovery/pull/1244
2017-12-13 14:43:44 -05:00
Harry Rein
2711fb521a Allowing a user to fulfill their entitlement on the programs dashboard.
LEARNER-3438

The user can now enroll in a session, unenroll from a session or change session
from a new course enrollment card on the programs dashboard.
2017-12-12 10:35:26 -05:00
McKenzie Welter
853cd9a0a7 show programs in which user holds a course entitlement on programs listing page 2017-12-11 12:22:36 -05:00
Anthony Mangano
f72cf800e1 Consider user entitlements and use entitlement products in bundle one-click purchase 2017-11-30 13:59:46 -05:00