Commit Graph

49991 Commits

Author SHA1 Message Date
Jeremy Bowman
237d264a50 DEPR-12 Remove microsites references from edxmako (#20796) 2019-06-11 15:27:10 -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 cache uploader bot
a6c802b3f1 Updating Bokchoy testing database cache (#20788) 2019-06-11 12:24:54 -04: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
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
Zia Fazal
8c5a53a1f4 Merge pull request #20792 from edx/ziafazal/WL-1927-b
Bumped edx-enterprise version
2019-06-11 19:02:55 +05:00
David Ormsbee
042297c10b Merge pull request #20791 from edx/jenkins/upgrade-python-requirements-1198e5f
Python Requirements Update
2019-06-11 09:14:09 -04:00
Christie Rice
4aba1b21a1 REVEM-372 Remove add_audit_deadline and deprecated_metadata waffle flags (#20769) 2019-06-11 09:05:06 -04:00
Zia Fazal
be9f5f5825 Bumped edx-enterprise version 2019-06-11 17:54:09 +05:00
edX requirements bot
3a460622f7 Updating Python Requirements 2019-06-11 06:51:27 -04:00
Ned Batchelder
7b9040f6b0 This enum was backwards 2019-06-10 15:27:39 -04:00
Ned Batchelder
f0fa5f7169 Enable Studio API docs in devstack 2019-06-10 15:27:39 -04:00
Ned Batchelder
135cbe76d8 yasg settings 2019-06-10 15:27:39 -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
8a44397139 Is this field missing because it is None? 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
fdd66e5390 Adjust the expected error message for DRF 3.7.7 2019-06-10 15:27:39 -04:00
Ned Batchelder
de8e158ce8 Un-truncate test failure diffs 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
c60da18de5 make upgrade
Because we added drf-yasg and pinned djangorestframework
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
Jeremy Bowman
1198e5f29b Fix intermittent unit test failures (#20783) 2019-06-10 14:56:33 -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
Andytr1
83d1ad92d0 Merge pull request #20787 from edx/andytr1/fix_proctoring_options
Potential fix for review rules - EDUCATOR-4262
2019-06-10 12:39:40 -04:00
Brittney Exline
5b14158470 Merge pull request #20779 from edx/bexline/unpin-edx-enterprise
Unpin edx-enterprise and edx-drf-extensions
2019-06-10 12:12:45 -04:00
atesker
817de2b215 Potential fix for review rules - EDUCATOR-4262 2019-06-10 10:56:13 -04:00
Dave St.Germain
23ab20a6fd Prevent import failure on CMS 2019-06-10 10:49:06 -04:00
Feanil Patel
266bfb5419 Merge pull request #20781 from edx/feanil/automate_script_makefile
Add a script requirements file to upgrade automation.
2019-06-10 10:20:49 -04:00
atesker
6ed1bb72cc Potential fix for review rules - EDUCATOR-4262 2019-06-10 09:54:11 -04:00
atesker
b5acb55dcc Potential fix for review rules - EDUCATOR-4262 2019-06-10 09:32:22 -04:00
David Ormsbee
c80d8811c7 Merge pull request #20784 from edx/jenkins/upgrade-python-requirements-01e1f23
Python Requirements Update
2019-06-08 10:41:46 -04:00
edX requirements bot
84ef1f277c Updating Python Requirements 2019-06-08 06:50:00 -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
Farhanah Sheets
2186b1a40b Merge pull request #20777 from edx/fsheets/about-page-message
Add in messaging for 403 errors on about pages & update error color for a11y
2019-06-07 15:18:06 -04:00
Feanil Patel
14c642dab6 Add a script requirements file to upgrade automation.
The xblock counting script had a requirements file that was not
previously being tracked and had an out of date version of requests.
Add it to the `upgrade` make target so that it stays up to date.
2019-06-07 15:10:40 -04:00
Feanil Patel
77eb3d2a82 Merge pull request #20778 from edx/renovate/edx-edx-bootstrap-1.x
Update dependency @edx/edx-bootstrap to v1.0.4
2019-06-07 14:54:26 -04:00
Brittney Exline
96cc889171 Unpin edx-enterprise and edx-drf-extensions 2019-06-07 14:35:38 -04:00
Feanil Patel
d75f98a0a1 Run npm install in devstack.
The output that renovate generates is different from what the version of
npm we're using generates.
2019-06-07 13:42:19 -04:00
Renovate Bot
051a000bac Update dependency @edx/edx-bootstrap to v1.0.4 2019-06-07 16:02:27 +00:00
Feanil Patel
093b51f743 Merge pull request #20775 from edx/feanil/correctly_pin_jasmin_jquery
Version 2.1.1 on NPM is not exactly the thing we use.
2019-06-07 12:00:54 -04:00
Matthew Piatetsky
aba836b517 Merge pull request #20674 from edx/REVEM-354
add discount banner to track selection and discount price to upgrade button
2019-06-07 11:35:34 -04:00
Feanil Patel
77a2317170 Merge pull request #20764 from edx/renovate/npm-moment-vulnerability
Update dependency moment to v2.19.3 [SECURITY]
2019-06-07 11:28:28 -04:00
Farhanah Sheets
6bd3f2ff51 Add in messaging for 403 error cases on about pages and update error color for a11y 2019-06-07 11:22:52 -04:00
Feanil Patel
5a4a99d806 Version 2.1.1 on NPM is not exactly the thing we use.
It looks like the package maintainers had a v2.1.1 that was on github
but then released a different 2.1.1 to NPM.  When renovate(upgrade
automation) tries to make any changes, it updates the lockfile to point
to the NPM one which currently breaks tests.

Pinning to the correct version in the package.json so that we can get
other things upgraded.
2019-06-07 11:08:55 -04:00
Feanil Patel
2e6675938c Fix tests while still upgrading moment.
- Moved jasmin-jquery back to pointing at git.  The version on NPM is
not the same because they made more changes to 2.1.1 before releasing it
to NPM.

- Run `npm install` locally because it produces slightly different
output than renovate which causes the quality tests to fail.
2019-06-07 10:52:07 -04:00
edX requirements bot
2c5ac0407f Updating Python Requirements (#20772) 2019-06-07 10:19:38 -04:00
Feanil Patel
5694753ce6 Merge pull request #20765 from edx/renovate/npm-react-dom-vulnerability
Update dependency react-dom to v16.1.2 [SECURITY]
2019-06-07 10:09:19 -04:00