Commit Graph

93 Commits

Author SHA1 Message Date
M. Zulqarnain
41e5403f4e BOM-2369 (D): pyupgrade on contentstore/views (#26767)
* pyupgrade on contentstore/views

* Apply suggestions from code review

Co-authored-by: Usama Sadiq <usama.sadiq@arbisoft.com>

Co-authored-by: Usama Sadiq <usama.sadiq@arbisoft.com>
2021-03-05 14:55:14 +05:00
usamasadiq
7bbde8f0f5 Applied pylint-amnesty 2021-02-08 13:00:22 +05:00
Régis Behmo
a16cd71046 Start waffle namespace deprecation
By explicitly importing the legacy namespace classes, we make it clear
that we are using soon-to-be-deprecated classes. We will then be able to
start removing the legacy classes, one module at a time.
2020-12-03 16:06:14 +01: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
Alan Zarembok
e4befb1926 Add new generate_video_upload_link api. 2020-11-05 12:04:45 -05:00
DawoudSheraz
84d2a690bf update devstack video upload authentication mechanism 2020-11-04 14:47:33 +05:00
Régis Behmo
4586002956 Import waffle classes from edx_toggles instead of waffle_utils
Those classes were ported to edx_toggles. The imports remain in
waffle_utils.__init__ for backward compatibility.
2020-11-03 19:25:37 +01:00
Kyle McCormick
a3deb6e317 Sort imports in cms/
Command: `isort --recursive cms/`
2020-10-19 09:34:31 -04:00
Kyle McCormick
538dbf696b Import CMS code using fully qualified module names
or, using proper the proper Python 3 relative imports
(e.g., 'from .views import x') which are standard and
unambiguous.
2020-10-19 09:34:31 -04:00
DawoudSheraz
b80fefdbdd remove VEDA reference from platform 2020-09-28 10:14:32 +05:00
Régis Behmo
307457a255 Simplify hack to obtain waffle module names
Instead of going up the stacktrace to find the module names of waffle
flags and switches, we manually pass the module __name__ whenever the
flag is created. This is similar to `logging.getLogger(__name__)`
standard behaviour.

As the waffle classes are used outside of edx-platform, we make the new
module_name argument an optional keyword argument. This will change once
we pull waffle_utils outside of edx-platform.

Note that the module name is normally only required to view the list of
existing waffle flags and switches. The module name should not be
necessary to verify if a flag is enabled. Thus, maybe it would make
sense to create a `add` class methor similar to:

    class WaffleFlag:
        @classmethod
        def add(cls, namespace, flag, module):
            instance = cls(namespace, flag)
            cls._class_instances.add((instance, module))
2020-09-14 09:30:24 +02:00
Régis Behmo
ba18d48ac3 Get rid of lepl deprecation warning by removing rfc6266 dependency (#24059)
The LEPL dependency was triggering a lot of deprecation warnings of the
form:

    venv/lib/python3.5/site-packages/lepl/matchers/support.py:497:
    DeprecationWarning: inspect.getargspec() is deprecated, use
    inspect.signature() instead
    argspec = getargspec(func)

It turns out that LEPL was only used by the rfc6266_parser package, which
itself was only used in one place to generate utf8-compliant
Content-Disposition headers.

This issue was noticed here:
https://github.com/SWW13/python-rfc6266-parser/issues/2
Unfortunately it is quite difficult to extract LEPL from the
rfc6266-parser package.

The rfc6266-parser package (https://pypi.org/project/rfc6266-parser/) is
itself a fork of the now-unmaintained rfc6266 package
(https://pypi.org/project/rfc6266/). Thus, it became high time to get
rid of this package. The FileResponse object can appropriately set the
Content-Disposition header, and thus replace the rfc6266 functionality,
since Django 2.0: https://code.djangoproject.com/ticket/16470

In our testing, the FileResponse object correctly set the
`filename*=utf-8''` value, following the RFC. The only difference is
that it does not provide "filename" fallback value, as expressed in the
RFC: https://tools.ietf.org/html/rfc6266#appendix-D

With rfc6266_parser:

    >> import rfc6266_parser
    >> rfc6266_parser.build_header("my_file_é.csv", filename_compat="video_urls.csv")
    b"attachment; filename=video_urls.csv; filename*=utf-8''my_file_%C3%A9.csv"

With FileResponse we have:

    >> from django.http import FileResponse
    >> import io
    >> response = FileResponse(io.StringIO(), as_attachment=True, filename="my_file_é.csv", content_type="text/csv")
    >> response.get("Content-Disposition")
    "attachment; filename*=utf-8''my_file_%C3%A9.csv"

We consider that this is a sufficiently minor difference, that will
impact very few browsers.
2020-08-31 09:30:27 -04:00
DawoudSheraz
12f2e6eb2b remove percentage field from VEM pipeline config model 2020-08-07 10:25:52 +05:00
Robert Raposa
77e490f057 ARCHBOM-1305: remove deprecated flag_undefined_default (#24426)
This is the final step in removing the deprecated
flag_undefined_default as explained by the following ADR:
https://github.com/edx/edx-platform/blob/master/openedx/core/djangoapps/waffle_utils/docs/decisions/0001-refactor-waffle-flag-default.rst

Notes:

* All uses of flag_undefined_default=False were always
  supposed to have been no-ops.
* All uses of flag_undefined_default=True that are removed
  in this PR have been replaced by migrations in past PRs.
* The temporary metric temp_flag_default_used id no longer
  reporting any data.

ARCHBOM-1305
2020-07-09 09:31:31 -04:00
Zainab Amir
0b80987ba0 Add vem_enabled_courses_percentage (#24294)
Add a field to VEM config model that will decide the percentage of
courses allowed to go to VEM pipeline. The courses that don't meet the
criteria will go to VEDA.

PROD-1722
2020-06-26 14:30:42 +05:00
Zainab Amir
cdc1c91980 Integrate Video Encode Manager (#24093)
* Add VEMPipelineIntegration config model
* Add course waffle flag to enable vem pipeline selectively

PROD-1636
2020-06-04 11:45:34 +05:00
Zainab Amir
87a1c06d4b Display encode and transcript status (#23919)
* Have separate column for transcript and encode status
* Display error message sent from VEM

PROD-1432
2020-05-12 16:12:07 +05:00
Syed Muhammad Dawoud Sheraz Ali
6a78c30ac8 add transcript failed status (#23838) 2020-05-06 10:13:13 +05:00
Zainab Amir
f10adf5e6a Add new transcription status (#23766)
Added new transcription status to represent *partial failure*,
meaning some jobs failed while others passed

PROD-1486
2020-04-22 13:08:47 +05:00
Zainab Amir
ed25521f61 Enable testing pipeline for video uploads to s3 (#23375)
Add integration settings to enable upload of videos from from studio.
Settings enable user to connect to s3 bucket using mfa and assume role
functionality.

PROD-1214
2020-03-12 12:19:52 +05: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
Ayub khan
6f1d379a0f BOM-376
python3 compatibility fixes all tests
2019-09-20 16:01:06 +05:00
aarif
cde8a2a62a python 3 fixes
changes made as suggested

minor change

changes made as suggested

test fixes for python 2

removed debug statement

quality fixes

quality fix

quality fix
2019-09-16 13:13:45 +05:00
aarif
b20eb309ff ran python-modernize and isort on files mentioned in INCR-332
changes made to comply with pylint

refactored the code to comply with PEP8

further changes made to comply with quality

changes made as suggested
2019-07-22 10:02:59 +00:00
cclauss
44d62fac75 Fix explicit tuple parameters for Python 3 2019-02-19 12:37:34 +01:00
Matthew Piatetsky
7df30938c4 fix unicode strings in cms/ 2019-02-04 13:01:51 -05:00
noraiz-anwar
e66ec8bd17 fix typo in message 2019-01-10 17:05:36 +05:00
noraiz-anwar
3b7918b07a Add basic pagination in video upload page 2019-01-04 23:06:57 +05:00
Qubad786
e24438602d Deprecate youtube for existing courses by not sending course_video_upload_token to VEDA. 2018-09-04 19:07:03 +05:00
Mushtaq Ali
7698a277cd Scrape video thumbnails from youtube util - EDUCATOR-3109 2018-09-04 19:07:03 +05:00
Jeremy Bowman
68902a2f3f TE-2689 Remove useless pylint suppressions part 3 2018-08-16 09:57:01 -04:00
Qubad786
b961569d35 Fix integrity errors 2018-08-08 19:42:21 +05:00
Qubad786
aa2afd8c0b Video status improvements 2018-06-25 20:43:21 +05: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
Feanil Patel
0872d2b591 Move off of our fork onto a published fork of the rfc6266.
The published fork seems to be getting updates more regularly than the original project
and has the bugfix we forked for.
2018-05-23 09:28:03 -04:00
muhammad-ammar
aaaafee2b2 remove video transcript enabled flag 2018-04-30 15:59:32 +05:00
Qubad786
c90aa33cb8 Integrate with the updated VAL api utils. 2018-02-16 19:06:44 +05:00
Gregory Martin
c1a4184acd Swap out exception class 2018-02-05 16:45:17 -05:00
Gregory Martin
61b8bd4d7a Update video record handling defensiveness 2018-01-31 16:58:51 -05:00
Mushtaq Ali
6af1215bcd Add delete js tests 2018-01-12 15:25:00 +05:00
Qubad786
55001ca81a Transcript delete on Video Upload Page - EDUCATOR-1961 2018-01-11 13:08:07 +05:00
Mushtaq Ali
c0d86360f0 Improve trancript sorting - EDUCATOR-2030 2018-01-10 17:02:21 +05:00
Qubad786
4f422e37d9 Refactor transcript upload handler to add language-overwrite support - EDUCATOR-2022 2018-01-09 17:03:45 +05:00
Qubad786
090e5dc534 Transcript upload backend for Video Upload Page – EDUCATOR-1854 2018-01-09 17:03:44 +05:00
Qubad786
c760c6a01b Download transcript on video upload page - EDUCATOR-1853 2018-01-09 17:03:44 +05:00
Mushtaq Ali
e601767329 Show transcripts on video uploads page - EDUCATOR-1662 2018-01-09 17:03:43 +05:00
Jeremy Bowman
d44e6297ae PLAT-1847 Fix cms tests under Django 1.9 2017-12-13 15:29:02 -05:00
Qubad786
dc335a2215 EDUCATOR-1628
Enable Video Uploads by default with course rollout flag.
2017-11-29 12:27:20 +05:00
muhammad-ammar
d78557a40b pass course id as string to edxval api method 2017-11-13 12:28:19 +05:00
Muzaffar yousaf
7157ec2e2f Revert "Revert "Transcript secure credentials"" 2017-11-08 21:18:00 +05:00