Commit Graph

19553 Commits

Author SHA1 Message Date
Nadeem Shahzad
441d2e44b9 Merge pull request #20818 from edx/nadeem/OPS-4041
Defaults to common.py lms (OPS-4041)
2019-06-25 18:47:12 +05:00
nadeemshahzad
993a21181a defaults to common.py 2019-06-25 13:01:29 +00:00
Adeel Khan
298d3554fe Fix templates for XSS code injection via translations
This would patch all templates (django/mako)
for a possible XSS code injection via
translation files by html escaping them..

LEARNER-4632
2019-06-25 14:22:42 +05:00
Hammad Ahmad Waqas
34589393ac Merge pull request #20840 from edx/hammad/WL-1492
WL-1492 | Remove arbitrary code rendering on course about page
2019-06-25 11:20:07 +05:00
Christie Rice
eeb265e276 REVEM-376 Disable waffle flags by default (#20880) 2019-06-24 11:31:10 -04:00
Christie Rice
b8401beaae REVEM-374 Remove course prices from dashboard (#20856) 2019-06-24 08:56:05 -04:00
Mushtaq Ali
07addf5f22 Merge pull request #20853 from edx/mushtaq/fix-csrf-referer-not-trusted
Add CSRF_TRUSTED_ORIGINS settings
2019-06-24 16:18:10 +05:00
DawoudSheraz
b37e679c39 remove staff exemption from the library_content transformer 2019-06-24 11:05:11 +05:00
Douglas Hall
f9d599a1a0 Add Discover New link to LMS header. (#20875) 2019-06-21 15:41:06 -04:00
Calen Pennington
b14244fe01 Merge pull request #20862 from cpennington/mobile-fbe-fields
Allow a limited subset of fields in the Course Block View for blocks …
2019-06-21 12:25:56 -04:00
Manjinder Singh
a787cd51cf Merge pull request #20801 from edx/msingh/INCR-482
INCR-482: ran python modernization and isort
2019-06-21 11:10:37 -04:00
Andytr1
cac4ec0047 Merge pull request #20843 from edx/andytr1/grades_show_email_for_masters_track_only
EDUCATOR-4319 gradebook show student email only for master's track.
2019-06-21 09:29:58 -04:00
Hammad Ahmad Waqas
63d7b7d6fa applying filter to remove dangerous html content before rendering in
course_about page on course overview field
2019-06-21 16:06:26 +05:00
Amit
df949d6de1 INCR-480: Make compatible with Python 3.x and fixed line over length limit (#20833) 2019-06-20 16:20:49 -04:00
Calen Pennington
093fc9f68a Allow a limited subset of fields in the Course Block View for blocks that have been denied authorization 2019-06-20 15:23:32 -04:00
atesker
68ec2e184d gradebook show student email only for master's track.
gradebook show student email only for master's track.

show emails for masters track - unit tests pass

fixed more unit tests and linting
2019-06-20 14:51:38 -04:00
usama sadiq
1630911131 Updated to Python3
Added absolute import in both files
2019-06-20 16:07:17 +05:00
Mushtaq Ali
d9a67496ff Add CSRF_TRUSTED_ORIGINS settings to successfully make POST requests from edx-learner-portal to edx-platform - ENT-2025 2019-06-19 16:04:24 +05:00
amitvadhel
05bf848b1f INCR-477: pylint: disable import-error for urljoin 2019-06-19 09:16:03 +03:00
amitvadhel
94f410f432 INCR-477: Make compatible with Python 3.x 2019-06-19 08:35:43 +03:00
Calen Pennington
92d9a1f541 Merge pull request #20789 from cpennington/first-enroll-discount-strikeout
Add strike-out price to LMS Course Home sidebar
2019-06-18 13:02:15 -04:00
Zainab Amir
fa8aeb69d9 Remove Remember me button from login page
Remember me button does the same thing regardless of if it is checked
or not. Remember me button being unchecked makes a user think they
will be logged out at the end of a browsing session when this is in
fact not the case

LEARNER-6220
2019-06-18 17:30:37 +05:00
Calen Pennington
d2de618b20 Add strike-out price to LMS Course Home sidebar 2019-06-17 15:11:33 -04:00
Diana Huang
6604cf104e Remove more microsites code. 2019-06-14 15:22:32 -04:00
Diana Huang
58a363e9d4 Remove microsites from commerce and theming. 2019-06-14 15:20:50 -04:00
Jeremy Bowman
45e390d0ea Upgrade to edx-opaque-keys 1.0.1 (#20817) 2019-06-14 12:15:44 -04:00
Usama Sadiq
7373a021cc Merge pull request #20816 from edx/usama/prod-338-support-contact-us-form
Support Contact Form Updated
2019-06-14 18:52:18 +05:00
usama sadiq
44475b9efc Support Contact Form Updated
- Changed the Subject text field to drop down.
- Added aditional text to guide learners to course forums.
2019-06-14 18:22:14 +05:00
Michael Roytman
05c0510cd3 add external_user_key to response and add ability to search by username, email, or external user key
Code review comments - EDUCATOR-4319

undoing changes temporarily

undoing changes temporarily

Fixed exception handling

re-added changes after hard reset

removed waffle flag (wrong merge

removed waffle flag (wrong merge
2019-06-14 08:36:00 -04:00
Douglas Hall
fc88c55c76 Header logo should now redirect to learner dashboard. (#20815) 2019-06-13 11:07:08 -04:00
David Ormsbee
68905ef4aa Merge pull request #19165 from EDUlib/cert-translate-2
Message related to certificate on courseware progress page are translated to platform language only. Part 2 of 2.
2019-06-12 13:04:46 -04:00
Truong David
9dd5cb86c1 Fix translation issue related to message showed on courseware progress
page related to certification and course mode. Part 2 of 2.

Use ugettext_lazy instead of ugettext to ensure the strings shown are in
the language the user chose. Otherwise the strings are in the platform
language.
Keep the original ugettext for function financial_assistance_form.
The test for that function fails if the text is not in english.
2019-06-12 12:20:16 -04:00
msingh
215dde1eca Fixing error introduced by formatter 2019-06-12 10:55:32 -04:00
msingh
7e26fa3823 Fixing quility test 2019-06-12 10:42:48 -04:00
Ned Batchelder
39c7a2db7c Revert "Use drf-yasg for Open API documentation" 2019-06-11 16:05:00 -04:00
tanyaxp
a7bc22eb9c Remove the course name from the enroll button. (#20635)
Remove the course name from the enroll button.

Replace the course name and change the button text to ‘Enroll Now’. The course name appears above this button.

Use case: The Threat of Nuclear Terrorism course team would prefer "Enroll Now” instead of "Enroll in Nuclear Terrorism" because of various interpretations of what "enrolling in nuclear terrorism" could mean.
2019-06-11 15:59:22 -04:00
msingh
f441a262cd INCR-482: ran python modernization and isort 2019-06-11 15:20:37 -04:00
Ned Batchelder
756dd88691 Merge pull request #20393 from edx/nedbat/drf-yasg
Use drf-yasg for Open API documentation
2019-06-11 13:58:13 -04:00
edx-pipeline-bot
de5d25eccc Merge pull request #20794 from edx/private_to_public_55dd3e1
Mergeback PR from private to public.
2019-06-11 19:17:13 +05:00
Christie Rice
4aba1b21a1 REVEM-372 Remove add_audit_deadline and deprecated_metadata waffle flags (#20769) 2019-06-11 09:05:06 -04:00
Ned Batchelder
8774ff1f9b Use ref_name to disambiguate serializers that drf-yasg would otherwise assume are the same. 2019-06-10 15:27:39 -04:00
Ned Batchelder
4a1154a7ca Give a safer buffer for clearing the rate limiting
The rate limiter counts requests in a 5-minute window.  To be sure we
aren't hitting edge cases, make the future requests 6 minutes plus 1
second in the future.
2019-06-10 15:27:39 -04:00
Ned Batchelder
64c47856dd DRF 3.7.4 changed how you delegate to another view, so don't
The error in the test was:
```
AssertionError: The `request` argument must be an instance of `django.http.HttpRequest`, not `rest_framework.request.Request`.
```
The (controversial) incompatible change was in 3.7.4: https://github.com/encode/django-rest-framework/pull/5618

I'll look into whether there's another way to address it.

<details>
  <summary>Full error report</summary>

```
AssertionError: The `request` argument must be an instance of `django.http.HttpRequest`, not `rest_framework.request.Request`.

Stacktrace

self = <lms.djangoapps.discussion_api.tests.test_views.CommentViewSetListTest testMethod=test_profile_image_request_for_null_endorsed_by>

    def test_profile_image_request_for_null_endorsed_by(self):
        """
        Tests if 'endorsed' is True but 'endorsed_by' is null, the api does not crash.
        This is the case for some old/stale data in prod/stage environments.
        """
        self.register_get_user_response(self.user)
        thread = self.make_minimal_cs_thread({
            "thread_type": "question",
            "endorsed_responses": [make_minimal_cs_comment({
                "id": "endorsed_comment",
                "user_id": self.user.id,
                "username": self.user.username,
                "endorsed": True,
            })],
            "non_endorsed_resp_total": 0,
        })
        self.register_get_thread_response(thread)
        self.create_profile_image(self.user, get_profile_image_storage())

        response = self.client.get(self.url, {
            "thread_id": thread["id"],
            "endorsed": True,
>           "requested_fields": "profile_image",
        })

lms/djangoapps/discussion_api/tests/test_views.py:1446:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../venvs/edxapp/local/lib/python2.7/site-packages/rest_framework/test.py:291: in get
    response = super(APIClient, self).get(path, data=data, **extra)
../venvs/edxapp/local/lib/python2.7/site-packages/rest_framework/test.py:208: in get
    return self.generic('GET', path, **r)
../venvs/edxapp/local/lib/python2.7/site-packages/rest_framework/test.py:237: in generic
    method, path, data, content_type, secure, **extra)
../venvs/edxapp/local/lib/python2.7/site-packages/django/test/client.py:416: in generic
    return self.request(**r)
../venvs/edxapp/local/lib/python2.7/site-packages/rest_framework/test.py:288: in request
    return super(APIClient, self).request(**kwargs)
../venvs/edxapp/local/lib/python2.7/site-packages/rest_framework/test.py:240: in request
    request = super(APIRequestFactory, self).request(**kwargs)
../venvs/edxapp/local/lib/python2.7/site-packages/django/test/client.py:501: in request
    six.reraise(*exc_info)
../venvs/edxapp/local/lib/python2.7/site-packages/django/core/handlers/exception.py:41: in inner
    response = get_response(request)
../venvs/edxapp/local/lib/python2.7/site-packages/django/core/handlers/base.py:249: in _legacy_get_response
    response = self._get_response(request)
../venvs/edxapp/local/lib/python2.7/site-packages/django/core/handlers/base.py:187: in _get_response
    response = self.process_exception_by_middleware(e, request)
../venvs/edxapp/local/lib/python2.7/site-packages/django/core/handlers/base.py:185: in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
../venvs/edxapp/local/lib/python2.7/site-packages/django/utils/decorators.py:185: in inner
    return func(*args, **kwargs)
../venvs/edxapp/local/lib/python2.7/site-packages/django/views/decorators/csrf.py:58: in wrapped_view
    return view_func(*args, **kwargs)
../venvs/edxapp/local/lib/python2.7/site-packages/rest_framework/viewsets.py:95: in view
    return self.dispatch(request, *args, **kwargs)
../venvs/edxapp/local/lib/python2.7/site-packages/rest_framework/views.py:494: in dispatch
    response = self.handle_exception(exc)
../venvs/edxapp/local/lib/python2.7/site-packages/rest_framework/views.py:491: in dispatch
    response = handler(request, *args, **kwargs)
lms/djangoapps/discussion_api/views.py:505: in list
    form.cleaned_data["requested_fields"],
lms/djangoapps/discussion_api/api.py:659: in get_comment_list
    results = _serialize_discussion_entities(request, context, responses, requested_fields, DiscussionEntity.comment)
lms/djangoapps/discussion_api/api.py:468: in _serialize_discussion_entities
    request, results, usernames, discussion_entity_type, include_profile_image
lms/djangoapps/discussion_api/api.py:413: in _add_additional_response_fields
    username_profile_dict = _get_user_profile_dict(request, usernames=','.join(usernames))
lms/djangoapps/discussion_api/api.py:350: in _get_user_profile_dict
    user_profile_details = AccountViewSet.as_view({'get': 'list'})(request).data
../venvs/edxapp/local/lib/python2.7/site-packages/django/views/decorators/csrf.py:58: in wrapped_view
    return view_func(*args, **kwargs)
../venvs/edxapp/local/lib/python2.7/site-packages/rest_framework/viewsets.py:95: in view
    return self.dispatch(request, *args, **kwargs)
../venvs/edxapp/local/lib/python2.7/site-packages/rest_framework/views.py:477: in dispatch
    request = self.initialize_request(request, *args, **kwargs)
../venvs/edxapp/local/lib/python2.7/site-packages/rest_framework/viewsets.py:118: in initialize_request
    request = super(ViewSetMixin, self).initialize_request(request, *args, **kwargs)
../venvs/edxapp/local/lib/python2.7/site-packages/rest_framework/views.py:381: in initialize_request
    parser_context=parser_context
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <rest_framework.request.Request object at 0x7f597c773890>
request = <rest_framework.request.Request object at 0x7f597fa20f90>
parsers = [<openedx.core.lib.api.parsers.MergePatchParser object at 0x7f59810c32d0>]
authenticators = [<edx_rest_framework_extensions.auth.jwt.authentication.JwtAuthentication object at 0x7f597c713690>, <openedx.core.lib...rest_framework_extensions.auth.session.authentication.SessionAuthenticationAllowInactiveUser object at 0x7f597c773390>]
negotiator = <rest_framework.negotiation.DefaultContentNegotiation object at 0x7f597fa20410>
parser_context = {'args': (), 'kwargs': {}, 'view': <openedx.core.djangoapps.user_api.accounts.views.AccountViewSet object at 0x7f597c7846d0>}

    def __init__(self, request, parsers=None, authenticators=None,
                 negotiator=None, parser_context=None):
        assert isinstance(request, HttpRequest), (
            'The `request` argument must be an instance of '
            '`django.http.HttpRequest`, not `{}.{}`.'
>           .format(request.__class__.__module__, request.__class__.__name__)
        )
E       AssertionError: The `request` argument must be an instance of `django.http.HttpRequest`, not `rest_framework.request.Request`.

../venvs/edxapp/local/lib/python2.7/site-packages/rest_framework/request.py:159: AssertionError
```
</details>
2019-06-10 15:27:39 -04:00
Ned Batchelder
7359ca4fb2 Is this right? It fixes two tests 2019-06-10 15:27:39 -04:00
Ned Batchelder
9257f68fd8 The default TIME_ZONE should be UTC
In production, we use UTC as the time zone.  DRF 3.7.7 now puts all
times in the currently set timezone where it used to use UTC.  By
setting TIME_ZONE to UTC, we keep the same results we used to get.

In a few places, we had to change the expected test results to be UTC.
2019-06-10 15:27:39 -04:00
Ned Batchelder
5985480409 Add drf-yasg
* Install drf-yasg

* Add drf-yasg settings and urls

* Pin drf to make drf-yasg work

* Adjust config-models version to be compatible

* Remove django-rest-swagger (the old way)
2019-06-10 15:27:38 -04:00
Andytr1
765559c708 Merge pull request #20758 from edx/andytr1/grades_simple_history
Adding simple history to track grade changes. Educator-4347
2019-06-10 12:39:54 -04:00
Dave St.Germain
23ab20a6fd Prevent import failure on CMS 2019-06-10 10:49:06 -04:00
David Ormsbee
01e1f23f51 Merge pull request #20158 from cthai18/fix/create-account-text
Change button text for creating account
2019-06-07 17:36:32 -04:00
atesker
a914faf11c Adding simple history to track grade changes. Educator-4347
added migration

Adding simple history to track grade changes. Educator-4347
Adding migration file

Adding simple history to track grade changes. Educator-4347
Adding migration file

Adding simple history to track grade changes. Educator-4347
Adding migration file

Re-adding lms.djangoapps reference to see if it will fix the build issues

Re-adding lms.djangoapps reference to see if it will fix the build issues
2019-06-07 16:32:56 -04:00