Commit Graph

716 Commits

Author SHA1 Message Date
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
Ayub khan
5c47a3b425 BOM Project
Updated __unicode__ to __str__
2019-09-25 18:31:54 +05:00
Zia Fazal
b73979dc72 Added signal handler for COURSE_GRADE_NOW_PASSED
Added signal handler for COURSE_GRADE_NOW_PASSED to trigger single learner data transmission task in edx-enterprise.

Bumped edx-enterprise version to 1.10.7

Revert edx-enterprise version bump
2019-09-25 14:30:49 +05:00
Jeremy Bowman
553d35e53e Upgrade mock BOM-596 (#21717) 2019-09-24 10:14:17 -04:00
Emma Green
4783aed927 Enterprise users should not get the first purchase discount. 2019-09-23 14:30:38 -04:00
Matthew Piatetsky
d6dbaabd33 Merge pull request #21720 from edx/emma-green/use-the-user-from-parameter-to-check-flag
use the specified user from the parameter to determine if the flag is…
2019-09-20 10:49:23 -04:00
Feanil Patel
4eaf875741 BOM-621 Fix hashing in a bunch of places. 2019-09-19 15:53:39 -04:00
Emma Green
502c8b5bf5 use the specified user from the parameter to determine if the flag is enabled, rather than the request's user 2019-09-19 15:51:57 -04:00
DawoudSheraz
197d281a1b speech output for completion checkmarks 2019-09-11 09:26:51 +05:00
Awais Jibran
f98c819f74 Merge pull request #160 from edx/aj/add-noopener-to-new-window-urls
Update hyperlinks in platfrom
2019-09-06 11:43:38 +05:00
Ayub khan
da9c71557b -Remove unicode and use six.text_type 2019-09-02 16:14:02 +05:00
Awais Jibran
1a4eb7d2e8 Pervent reverse tabnabbing in edx platform 2019-08-28 16:08:34 +05:00
noraiz-anwar
1c4f9da92d improved quality of multiple files 2019-08-22 12:47:08 +05:00
Ayub
85be57b64a Merge pull request #21397 from edx/BOM-95
BOM-95
2019-08-22 12:41:08 +05:00
Emma Green
ef71b51137 Merge pull request #21399 from edx/emma-green/REV-901/remove-user-join-from-holdback
remove user.joined_date from holdback as this condition will create a…
2019-08-21 12:22:53 -04:00
Emma Green
fc003c428d remove user.joined_date from holdback as this condition will create a difference in the two a/b groups 2019-08-21 11:56:37 -04:00