Commit Graph

731 Commits

Author SHA1 Message Date
Zia Fazal
5b6e0514de Added caller in to the exception message
Added caller in to the exception message to debug ENT-1849
Replaced `get_enterprise_learner_data` method call with `enterprise_customer_for_request` to get enterprise customer data from cache or session instead of hitting API.
2019-11-11 19:44:24 +05:00
hasnain-naveed
057f443a26 ENT-2437 | get_enterprise_customer_for_learner method replaced with enterprise_customer_for_request. 2019-11-08 15:47:52 +05:00
Stu Young
e229279f3c fix invalid choices in toggle annotations (#22266) 2019-11-07 15:22:46 -05:00
Matthew Piatetsky
bd76a71019 delete old holdback code 2019-11-07 09:51:39 -05:00
Manjinder Singh
79c9231128 Revert "ENT-2437 | get_enterprise_customer_for_learner method replaced with e…" (#22248) 2019-11-05 16:51:44 -05:00
Matthew Piatetsky
6eb5466ee5 Merge pull request #22198 from edx/REV-693
[REV-693] Create table to keep track of FBE holdback experiment enrollments
2019-11-04 14:40:26 -05:00
julianajlk
afae1f1d2a a11y: add role to FPD banner (#22225)
REV-705
2019-11-04 10:46:53 -05:00
Matthew Piatetsky
8d8626ca1f address comments 2019-11-01 13:41:01 -04:00
hasnain-naveed
4b827d5be0 ENT-2437 | get_enterprise_customer_for_learner method replaced with enterprise_customer_for_request. 2019-11-01 17:19:56 +05:00
Matthew Piatetsky
c2774083ea create table that excludes enrollments from FBE 2019-10-31 16:30:52 -04:00
julianajlk
a4ca026c19 add missing parameter to discount_percentage 2019-10-25 16:28:33 -04:00
Calen Pennington
47b8dfae75 Merge pull request #22156 from cpennington/expose-course-duration
Expose user course duration in the user metadata
2019-10-25 13:49:14 -04:00
Matthew Piatetsky
9df790cca5 Merge pull request #22123 from edx/REV-728
[REV-728] add discount percentage configuration
2019-10-25 10:10:20 -04:00
Calen Pennington
d92dcb28bb Expose user course duration in the user metadata 2019-10-25 10:02:55 -04:00
Awais Qureshi
82fb16b2f7 BOM-981,983,984
Fixing migrations.
2019-10-24 14:53:39 +05:00
Matthew Piatetsky
86bb0cfa2c add discount percentage configuration 2019-10-23 12:00:34 -04:00
julianajlk
6e0914ad5d add FPD banner to courseware (#22113)
REV-980
2019-10-23 09:33:11 -04:00
Zia Fazal
7ccd2a6901 Refactored enterprise unlink code to fix ENT-1890
Refactored enterprise unlink code to fix ENT-1890

Fixed quality violations and brokent test

Fixed pylint quality violations

Fixed failing unit test

Fixed broken test after rebasing with master
2019-10-23 11:35:58 +05:00
Braden MacDonald
5fc73468b3 Change completion API to work with any learning context 2019-10-22 14:04:31 -04:00
Feanil Patel
9946fd3918 Merge pull request #22099 from edx/revert-22058-julianajlk/REV-980/first-purchase-discount-courseware
Revert "add first purchase discount to courseware (#22058)"
2019-10-22 09:39:08 -04:00
Calen Pennington
b3421c8580 Merge pull request #22084 from cpennington/expose-access-denial-reasons
Expose access denial reasons inside verticals to the front-end on the…
2019-10-21 15:44:37 -04:00
julianajlk
98f907f23c Revert "add first purchase discount to courseware (#22058)"
This reverts commit 059b619794.
2019-10-21 13:57:18 -04:00
julianajlk
059b619794 add first purchase discount to courseware (#22058)
REV-980.
* moved get_first_purchase_offer_banner_fragment to Discounts utils.py
* added banner wrapper method
* updated banner with time limit
2019-10-21 13:56:38 -04:00
Calen Pennington
4e6e283495 Expose access denial reasons inside verticals to the front-end on the course outline 2019-10-21 12:41:36 -04:00
Muhammad Ammar
19fd375dc9 Merge pull request #22012 from edx/ammar/ent-1964-allow-user-to-edit-fullname-if-no-social-auth-record
allow user to edit fullname if no social auth record exists
2019-10-21 11:35:26 +05:00
Matthew Piatetsky
ec8f9f8f86 disable discount when upgrade deadline has passed 2019-10-18 16:15:14 -04:00
muhammad-ammar
fc2915b02f allow user to edit fullname if no social auth record
ENT-1964
2019-10-18 15:30:51 +05:00
Emma Green
bb14195685 Merge pull request #22067 from edx/move-anon-user-check-earlier
move the anonymous check earlier so that it cannot error out when it …
2019-10-17 13:35:23 -04:00
Emma Green
def6bced98 move the anonymous check earlier so that it cannot error out when it expects a non-anonymous user 2019-10-17 12:54:36 -04:00
Calen Pennington
7ceb0e30fa Mark course outline with graded and scored status in the DOM so that we can run optimizely code on them 2019-10-17 12:14:49 -04:00
Matthew Piatetsky
7436f9c186 Merge pull request #21915 from edx/REV-733
[REV-733] check if discount expired
2019-10-16 12:03:58 -04:00
Matthew Piatetsky
f6d0bf77df check if discount expired 2019-10-16 11:32:27 -04:00
Zia Fazal
ebe29d9303 Merge pull request #21943 from edx/ziafazal/ENT-1688
ENT-1688: Changed logout message on on logout screen for Enterprise SSO flow
2019-10-15 18:53:34 +05:00
Zia Fazal
c718c02d6e Show blank screen instead of logout message for Enterprise SSO flow
Changes to show blank screen instead of logout message for Enterprise SSO flow. It confuses learner when they are already signed in and access their course from B2B site.
ENT-1688

Fixed pep8 quality violation

use testserver as HOST instead of edx.org

assert enterprise app is enabled

added logging

Print different values

Reload django url config

assert all quote operations to see how they work on jenkins

debug url resolved values

login user in setup

added log to debug test on jenkins

Using UrlResetMixin

Using regex instead of resolve

Fixed quality violation

Fixed pylint quality violations

Fixed target interpolation syntax

Added developer's comment
2019-10-15 18:28:19 +05:00
Zia Fazal
3b69a4f279 Invoke learner transmission task only for enterprise learners
Invoke learner transmission task only for enterprise learners
ENT-2384

added docstring

Fixed brokent unit test
2019-10-15 15:58:37 +05:00
Calen Pennington
355826f7d8 Don't try to show anonymous users the first-purchase discount
This fixes errors like:

    Oct 10 12:46:07 ip-10-2-10-15 [service_variant=lms][django.request][env:prod-edx-edxapp] ERROR [ip-10-2-10-15  31278] [user None] [exception.py:135] - Internal Server Error: /courses/course-v1:HarvardX+1962USRx+3T2019/discussions/settings
    Traceback (most recent call last):
    File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/handlers/exception.py", line 41, in inner
        response = get_response(request)
    File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
        response = self._get_response(request)
    File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 187, in _get_response
        response = self.process_exception_by_middleware(e, request)
    File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 185, in _get_response
        response = wrapped_callback(request, *callback_args, **callback_kwargs)
    File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/utils/decorators.py", line 185, in inner
        return func(*args, **kwargs)
    File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/newrelic/hooks/framework_django.py", line 539, in wrapper
        return wrapped(*args, **kwargs)
    File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/views/decorators/http.py", line 40, in inner
        return func(request, *args, **kwargs)
    File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/utils/decorators.py", line 149, in _wrapped_view
        response = view_func(request, *args, **kwargs)
    File "/edx/app/edxapp/edx-platform/common/djangoapps/util/json_request.py", line 55, in parse_json_into_request
        return view_function(request, *args, **kwargs)
    File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py", line 23, in _wrapped_view
        return view_func(request, *args, **kwargs)
    File "/edx/app/edxapp/edx-platform/lms/djangoapps/discussion/views.py", line 936, in course_discussions_settings_handler
        course, discussion_settings
    File "/edx/app/edxapp/edx-platform/lms/djangoapps/discussion/views.py", line 957, in get_divided_discussions
        all_discussions = utils.get_discussion_categories_ids(course, None, include_all=True)
    File "/edx/app/edxapp/edx-platform/lms/djangoapps/discussion/django_comment_client/utils.py", line 485, in get_discussion_categories_ids
        xblock.discussion_id for xblock in get_accessible_discussion_xblocks(course, user, include_all=include_all)
    File "/edx/app/edxapp/edx-platform/lms/djangoapps/discussion/django_comment_client/utils.py", line 146, in get_accessible_discussion_xblocks
        return get_accessible_discussion_xblocks_by_course_id(course.id, user, include_all=include_all)
    File "/edx/app/edxapp/edx-platform/openedx/core/lib/cache_utils.py", line 73, in decorator
        result = wrapped(*args, **kwargs)
    File "/edx/app/edxapp/edx-platform/lms/djangoapps/discussion/django_comment_client/utils.py", line 159, in get_accessible_discussion_xblocks_by_course_id
        if has_required_keys(xblock) and (include_all or has_access(user, 'load', xblock, course_id))
    File "/edx/app/edxapp/edx-platform/lms/djangoapps/courseware/access.py", line 158, in has_access
        return _has_access_descriptor(user, action, obj, course_key)
    File "/edx/app/edxapp/edx-platform/lms/djangoapps/courseware/access.py", line 572, in _has_access_descriptor
        return _dispatch(checkers, action, user, descriptor)
    File "/edx/app/edxapp/edx-platform/lms/djangoapps/courseware/access.py", line 669, in _dispatch
        result = table[action]()
    File "/edx/app/edxapp/edx-platform/lms/djangoapps/courseware/access.py", line 543, in can_load
        group_access_response = _has_group_access(descriptor, user, course_key)
    File "/edx/app/edxapp/edx-platform/lms/djangoapps/courseware/access.py", line 513, in _has_group_access
        user_fragment=partition.access_denied_fragment(descriptor, user, user_group, allowed_groups),
    File "/edx/app/edxapp/edx-platform/openedx/features/content_type_gating/partitions.py", line 98, in access_denied_fragment
        upgrade_price, _ = format_strikeout_price(user, course)
    File "/edx/app/edxapp/edx-platform/openedx/features/discounts/utils.py", line 22, in format_strikeout_price
        if can_receive_discount(user, course):
    File "/edx/app/edxapp/edx-platform/openedx/features/discounts/applicability.py", line 74, in can_receive_discount
        if CourseEnrollment.objects.filter(user=user).exclude(mode__in=CourseMode.UPSELL_TO_VERIFIED_MODES).exists():
    File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/models/manager.py", line 85, in manager_method
        return getattr(self.get_queryset(), name)(*args, **kwargs)
    File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/models/query.py", line 787, in filter
        return self._filter_or_exclude(False, *args, **kwargs)
    File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/models/query.py", line 805, in _filter_or_exclude
        clone.query.add_q(Q(*args, **kwargs))
    File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1250, in add_q
        clause, _ = self._add_q(q_object, self.used_aliases)
    File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1276, in _add_q
        allow_joins=allow_joins, split_subq=split_subq,
    File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1206, in build_filter
        condition = lookup_class(lhs, value)
    File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/models/lookups.py", line 24, in __init__
        self.rhs = self.get_prep_lookup()
    File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/models/fields/related_lookups.py", line 112, in get_prep_lookup
        self.rhs = target_field.get_prep_value(self.rhs)
    File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/models/fields/__init__.py", line 966, in get_prep_value
        return int(value)
    TypeError: int() argument must be a string or a number, not 'AnonymousUser'

This is tracked in https://openedx.atlassian.net/browse/REV-988
[REV-988]
2019-10-10 10:53:26 -04:00
Ayub khan
298fbdaec2 BOM-894 python3 order mismatch
Python3 arguments have different positions as compared to python2
2019-10-09 15:06:27 +05:00
Ayub khan
09843b993c BOM-893
python3 compatibility: regex needs bytes type strings to check bytes type response
2019-10-03 15:54:04 +05:00
Feanil Patel
59ae37b3ba Merge pull request #21903 from edx/feanil/fix_date_mock
Fix datetime mock to only mock the now function.
2019-10-02 09:44:57 -04:00
Feanil Patel
3132982141 Fix datetime mock to only mock the now function. 2019-10-01 16:17:45 -04:00
Diana Huang
ff795347dd Annotate a few of the course_experience waffle flags. 2019-10-01 16:03:36 -04:00
Nimisha Asthagiri
9bbc21ea8c Python 3: multi-lined assertIn, assertNotIn -> assertContains, assertNotContains 2019-09-30 08:51:02 -04:00
Nimisha Asthagiri
ccefde8d3c Python-3: assertNotIn(..response.content) -> assertNotContains 2019-09-30 08:50:38 -04:00
Nimisha Asthagiri
a6b219a9e9 Python-3: assertIn(..response.content) -> assertContains 2019-09-30 08:50:38 -04:00
Stu Young
7c6c166e73 fix toggle implementation annotations (#21802)
fix toggle implementation annotations and rename waffle flags
2019-09-27 11:45:40 -04:00
Matthew Piatetsky
c7c4f6073d Merge pull request #21798 from edx/PROD-713
show graded content block without the upsell when the upgrade deadline is expired
2019-09-27 09:54:26 -04:00
Matthew Piatetsky
0c03138229 show graded content block without the upsell when the upgrade deadline is expired 2019-09-26 17:49:08 -04:00
Ned Batchelder
efba6e45e8 Finally import courseware properly everywhere to get rid of a warning 2019-09-26 09:40:15 -04:00
Ayub
846a12939e Merge pull request #21735 from edx/BOM-update_str_method
BOM Project __unicode__ to __str__
2019-09-26 10:47:14 +05:00
Zia Fazal
19436f8d3d Bumped edx-enterprise version to 1.10.7
Fixed broken unit test

connected COURSE_GRADE_NOW_PASSED at the end

added receiver to signal connect call
2019-09-25 22:32:53 +05:00