diff --git a/lti_consumer/lti_1p3/consumer.py b/lti_consumer/lti_1p3/consumer.py index 87dd8606d37a9f4b2939d18b7a8a4381182899b7..42e816104d5a2bb5ddb7a71e6d1d485ebae38032 100644 --- a/lti_consumer/lti_1p3/consumer.py +++ b/lti_consumer/lti_1p3/consumer.py @@ -443,9 +443,7 @@ class LtiConsumer1p3: # If `allowed_scopes` is empty, return true (just check # token validity). if allowed_scopes: - return any( - [scope in allowed_scopes for scope in token_scopes] - ) + return any(scope in allowed_scopes for scope in token_scopes) return True diff --git a/lti_consumer/migrations/0011_update_jsonfield.py b/lti_consumer/migrations/0011_update_jsonfield.py new file mode 100644 index 0000000000000000000000000000000000000000..345a957474c8b20369e4292d50ef9112bce5be64 --- /dev/null +++ b/lti_consumer/migrations/0011_update_jsonfield.py @@ -0,0 +1,24 @@ +# Generated by Django 2.2.19 on 2021-03-01 14:52 + +from django.db import migrations +import jsonfield.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('lti_consumer', '0010_backfill-empty-string-lti-config'), + ] + + operations = [ + migrations.AlterField( + model_name='lticonfiguration', + name='lti_config', + field=jsonfield.fields.JSONField(blank=True, default=dict, help_text='LTI configuration data.'), + ), + migrations.AlterField( + model_name='ltidlcontentitem', + name='attributes', + field=jsonfield.fields.JSONField(), + ), + ] diff --git a/lti_consumer/models.py b/lti_consumer/models.py index e1a9e77ac90238c6d9be5ac37e0a51625a1f89d1..9198e141fb686bb6815b1dd4a75db117cf4a8714 100644 --- a/lti_consumer/models.py +++ b/lti_consumer/models.py @@ -451,7 +451,7 @@ class LtiAgsScore(models.Model): if self.score_given and self.score_maximum is None: raise ValidationError({'score_maximum': 'cannot be unset when score_given is set'}) - def save(self, *args, **kwargs): # pylint: disable=signature-differs + def save(self, *args, **kwargs): self.full_clean() super().save(*args, **kwargs) diff --git a/pylintrc b/pylintrc index 7bb43b6242d7a86e9338e763c43e8400c54f89f7..fd5329ef6617ff5819aa74a41867b0792a9c9288 100644 --- a/pylintrc +++ b/pylintrc @@ -68,15 +68,15 @@ # # ------------------------------ [MASTER] -ignore = +ignore = persistent = yes load-plugins = edx_lint.pylint,pylint_django,pylint_celery [MESSAGES CONTROL] -enable = +enable = blacklisted-name, line-too-long, - + syntax-error, init-is-generator, return-in-init, @@ -199,7 +199,7 @@ enable = anomalous-unicode-escape-in-string, bad-open-mode, boolean-datetime, - + fatal, astroid-error, parse-error, @@ -207,20 +207,20 @@ enable = django-not-available, raw-checker-failed, django-not-available-placeholder, - + empty-docstring, invalid-characters-in-docstring, missing-docstring, wrong-spelling-in-comment, wrong-spelling-in-docstring, - + unused-import, unused-variable, unused-argument, - + exec-used, eval-used, - + bad-classmethod-argument, bad-mcs-classmethod-argument, bad-mcs-method-argument, @@ -255,31 +255,31 @@ enable = model-has-unicode, model-no-explicit-unicode, protected-access, - + deprecated-module, deprecated-method, - + too-many-nested-blocks, too-many-statements, too-many-boolean-expressions, - + wrong-import-order, wrong-import-position, wildcard-import, - + missing-final-newline, mixed-line-endings, trailing-newlines, trailing-whitespace, unexpected-line-ending-format, mixed-indentation, - + bad-option-value, unrecognized-inline-option, useless-suppression, bad-inline-option, deprecated-pragma, -disable = +disable = bad-continuation, invalid-name, misplaced-comparison-constant, @@ -290,7 +290,7 @@ disable = global-statement, no-else-return, django-not-configured, - + apply-builtin, backtick, basestring-builtin, @@ -404,7 +404,7 @@ ignore-imports = no ignore-mixin-members = yes ignored-classes = SQLObject unsafe-load-any-extension = yes -generated-members = +generated-members = REQUEST, acl_users, aq_parent, @@ -430,7 +430,7 @@ generated-members = [VARIABLES] init-import = no dummy-variables-rgx = _|dummy|unused|.*_unused -additional-builtins = +additional-builtins = [CLASSES] defining-attr-methods = __init__,__new__,setUp @@ -451,9 +451,9 @@ max-public-methods = 20 [IMPORTS] deprecated-modules = regsub,TERMIOS,Bastion,rexec -import-graph = -ext-import-graph = -int-import-graph = +import-graph = +ext-import-graph = +int-import-graph = [EXCEPTIONS] overgeneral-exceptions = Exception diff --git a/requirements/base.in b/requirements/base.in index bd89e7b262d3e25038c0367a71bd4d18e723bea0..c5d31b848e68c699123e734f907315ec0c065b84 100644 --- a/requirements/base.in +++ b/requirements/base.in @@ -13,4 +13,4 @@ pycryptodomex pyjwkest edx-opaque-keys[django] django-filter -jsonfield2 +jsonfield diff --git a/requirements/base.txt b/requirements/base.txt index db83d32e7a0f2dda5d6f3d34093e140a4ff35ca7..4bcfcf524e18c12cfb7ff839eacac326925d37b9 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -6,7 +6,7 @@ # appdirs==1.4.4 # via fs -bleach==3.2.3 +bleach==3.3.0 # via -r requirements/base.in certifi==2020.12.5 # via requests @@ -14,13 +14,13 @@ chardet==4.0.0 # via requests django-filter==2.4.0 # via -r requirements/base.in -django==2.2.17 +django==2.2.19 # via # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt # -r requirements/base.in # django-filter # edx-opaque-keys - # jsonfield2 + # jsonfield edx-opaque-keys[django]==2.2.0 # via -r requirements/base.in fs==2.4.12 @@ -29,10 +29,8 @@ future==0.18.2 # via pyjwkest idna==2.10 # via requests -jsonfield2==3.0.3 - # via - # -c requirements/constraints.txt - # -r requirements/base.in +jsonfield==3.1.0 + # via -r requirements/base.in lazy==1.4 # via -r requirements/base.in lxml==4.6.2 @@ -49,23 +47,23 @@ markupsafe==1.1.1 # xblock oauthlib==3.1.0 # via -r requirements/base.in -packaging==20.8 +packaging==20.9 # via bleach pbr==5.5.1 # via stevedore -pycryptodomex==3.9.9 +pycryptodomex==3.10.1 # via # -r requirements/base.in # pyjwkest pyjwkest==1.4.2 # via -r requirements/base.in -pymongo==3.11.2 +pymongo==3.11.3 # via edx-opaque-keys pyparsing==2.4.7 # via packaging python-dateutil==2.8.1 # via xblock -pytz==2020.5 +pytz==2021.1 # via # django # fs @@ -98,7 +96,7 @@ web-fragments==1.0.0 # xblock-utils webencodings==0.5.1 # via bleach -webob==1.8.6 +webob==1.8.7 # via xblock xblock-utils==2.1.2 # via -r requirements/base.in diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 769dc5b05eb81958f349b218250027388db92acb..faf74b867b493425faad92c5f35c44f6e82111c1 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -24,6 +24,3 @@ stevedore<=1.32.0 # Same as in edx-platform djangorestframework==3.9.4 - -# jsonfield2 3.1.0 drops support for python 3.5 -jsonfield2<3.1.0 diff --git a/requirements/dev.txt b/requirements/dev.txt index e136e8b1d029f1af017a8ff30f2321034480597c..e182def6cfd0296468b130f3848bb0a86219edbd 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -26,7 +26,7 @@ django==2.2.19 # django-filter # edx-i18n-tools # edx-opaque-keys - # jsonfield2 + # jsonfield edx-i18n-tools==0.5.0 # via -r requirements/dev.in edx-opaque-keys[django]==2.2.0 @@ -43,7 +43,7 @@ idna==2.10 # via # -r requirements/base.txt # requests -jsonfield2==3.0.3 +jsonfield==3.1.0 # via -r requirements/base.txt lazy==1.4 # via -r requirements/base.txt diff --git a/requirements/django.txt b/requirements/django.txt index 34249f7c4a84f776365fab0985e5d77be5b03054..d3ed314a772435460a93aa5056b7faf353ada0af 100644 --- a/requirements/django.txt +++ b/requirements/django.txt @@ -1 +1 @@ -django==2.2.17 +django==2.2.19 diff --git a/requirements/pip_tools.txt b/requirements/pip_tools.txt index 53310ee5c8c409c5d91b7dc9660bf81b73c4bf24..97abba2168d2b62d99de319dc62a76f4048cfd15 100644 --- a/requirements/pip_tools.txt +++ b/requirements/pip_tools.txt @@ -6,7 +6,7 @@ # click==7.1.2 # via pip-tools -pip-tools==5.5.0 +pip-tools==6.0.0 # via -r requirements/pip_tools.in # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements/test.txt b/requirements/test.txt index df9008a120b1830b4896b277626c5c6c045811fa..70209f17168db09f374001b1210fa2cef47d86a1 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -8,15 +8,15 @@ appdirs==1.4.4 # via # -r requirements/base.txt # fs -astroid==2.4.2 +astroid==2.5.1 # via # pylint # pylint-celery -bleach==3.2.3 +bleach==3.3.0 # via -r requirements/base.txt -boto3==1.16.62 +boto3==1.17.27 # via fs-s3fs -botocore==1.19.62 +botocore==1.20.27 # via # boto3 # s3transfer @@ -35,13 +35,13 @@ click==7.1.2 # click-log # code-annotations # edx-lint -code-annotations==1.0.2 +code-annotations==1.1.0 # via edx-lint -coverage==5.4 +coverage==5.5 # via coveralls -coveralls==3.0.0 +coveralls==3.0.1 # via -r requirements/test.in -ddt==1.4.1 +ddt==1.4.2 # via -r requirements/test.in django-filter==2.4.0 # via -r requirements/base.txt @@ -55,7 +55,7 @@ django-pyfs==3.0 # django-pyfs # edx-lint # edx-opaque-keys - # jsonfield2 + # jsonfield # xblock-sdk djangorestframework==3.9.4 # via @@ -63,7 +63,7 @@ djangorestframework==3.9.4 # -r requirements/test.in docopt==0.6.2 # via coveralls -edx-lint==3.0.2 +edx-lint==4.1.0 # via -r requirements/test.in edx-opaque-keys[django]==2.2.0 # via -r requirements/base.txt @@ -85,17 +85,15 @@ idna==2.10 # requests isort==5.7.0 # via pylint -jinja2==2.11.2 +jinja2==2.11.3 # via code-annotations jmespath==0.10.0 # via # boto3 # botocore -jsonfield2==3.0.3 - # via - # -c requirements/constraints.txt - # -r requirements/base.txt -lazy-object-proxy==1.4.3 +jsonfield==3.1.0 + # via -r requirements/base.txt +lazy-object-proxy==1.5.2 # via astroid lazy==1.4 # via -r requirements/base.txt @@ -121,7 +119,7 @@ mock==3.0.5 # -r requirements/test.in oauthlib==3.1.0 # via -r requirements/base.txt -packaging==20.8 +packaging==20.9 # via # -r requirements/base.txt # bleach @@ -129,9 +127,9 @@ pbr==5.5.1 # via # -r requirements/base.txt # stevedore -pycodestyle==2.6.0 +pycodestyle==2.7.0 # via -r requirements/test.in -pycryptodomex==3.9.9 +pycryptodomex==3.10.1 # via # -r requirements/base.txt # pyjwkest @@ -145,13 +143,13 @@ pylint-plugin-utils==0.6 # via # pylint-celery # pylint-django -pylint==2.6.0 +pylint==2.7.2 # via # edx-lint # pylint-celery # pylint-django # pylint-plugin-utils -pymongo==3.11.2 +pymongo==3.11.3 # via # -r requirements/base.txt # edx-opaque-keys @@ -166,7 +164,7 @@ python-dateutil==2.8.1 # xblock python-slugify==4.0.1 # via code-annotations -pytz==2020.5 +pytz==2021.1 # via # -r requirements/base.txt # django @@ -191,7 +189,6 @@ simplejson==3.17.2 six==1.15.0 # via # -r requirements/base.txt - # astroid # bleach # edx-lint # fs @@ -229,7 +226,7 @@ webencodings==0.5.1 # via # -r requirements/base.txt # bleach -webob==1.8.6 +webob==1.8.7 # via # -r requirements/base.txt # xblock diff --git a/requirements/tox.txt b/requirements/tox.txt index e595e9cab10b7c801b1a169cda845d890d75e299..961e2d77864e4c42ff1c3172526ec02a24a0c8e0 100644 --- a/requirements/tox.txt +++ b/requirements/tox.txt @@ -12,7 +12,7 @@ filelock==3.0.12 # via # tox # virtualenv -packaging==20.8 +packaging==20.9 # via tox pluggy==0.13.1 # via tox @@ -26,7 +26,7 @@ six==1.15.0 # virtualenv toml==0.10.2 # via tox -tox==3.21.3 +tox==3.23.0 # via -r requirements/tox.in -virtualenv==20.4.0 +virtualenv==20.4.2 # via tox diff --git a/requirements/travis.txt b/requirements/travis.txt index 50bea58cbfc5c24ad9a7a03fbded33ef03042a4e..62a635a2d9d3ebb98fbb7d1439587eb21daf0dcb 100644 --- a/requirements/travis.txt +++ b/requirements/travis.txt @@ -10,18 +10,18 @@ appdirs==1.4.4 # -r requirements/tox.txt # fs # virtualenv -astroid==2.4.2 +astroid==2.5.1 # via # -r requirements/test.txt # pylint # pylint-celery -bleach==3.2.3 +bleach==3.3.0 # via -r requirements/test.txt -boto3==1.16.62 +boto3==1.17.27 # via # -r requirements/test.txt # fs-s3fs -botocore==1.19.62 +botocore==1.20.27 # via # -r requirements/test.txt # boto3 @@ -44,17 +44,17 @@ click==7.1.2 # click-log # code-annotations # edx-lint -code-annotations==1.0.2 +code-annotations==1.1.0 # via # -r requirements/test.txt # edx-lint -coverage==5.4 +coverage==5.5 # via # -r requirements/test.txt # coveralls -coveralls==3.0.0 +coveralls==3.0.1 # via -r requirements/test.txt -ddt==1.4.1 +ddt==1.4.2 # via -r requirements/test.txt distlib==0.3.1 # via @@ -64,7 +64,7 @@ django-filter==2.4.0 # via -r requirements/test.txt django-pyfs==3.0 # via -r requirements/test.txt -django==2.2.17 +django==2.2.19 # via # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt # -r requirements/test.txt @@ -73,7 +73,7 @@ django==2.2.17 # django-pyfs # edx-lint # edx-opaque-keys - # jsonfield2 + # jsonfield # xblock-sdk djangorestframework==3.9.4 # via @@ -83,7 +83,7 @@ docopt==0.6.2 # via # -r requirements/test.txt # coveralls -edx-lint==3.0.2 +edx-lint==4.1.0 # via -r requirements/test.txt edx-opaque-keys[django]==2.2.0 # via -r requirements/test.txt @@ -114,7 +114,7 @@ isort==5.7.0 # via # -r requirements/test.txt # pylint -jinja2==2.11.2 +jinja2==2.11.3 # via # -r requirements/test.txt # code-annotations @@ -123,11 +123,9 @@ jmespath==0.10.0 # -r requirements/test.txt # boto3 # botocore -jsonfield2==3.0.3 - # via - # -c requirements/constraints.txt - # -r requirements/test.txt -lazy-object-proxy==1.4.3 +jsonfield==3.1.0 + # via -r requirements/test.txt +lazy-object-proxy==1.5.2 # via # -r requirements/test.txt # astroid @@ -157,7 +155,7 @@ mock==3.0.5 # -r requirements/test.txt oauthlib==3.1.0 # via -r requirements/test.txt -packaging==20.8 +packaging==20.9 # via # -r requirements/test.txt # -r requirements/tox.txt @@ -175,9 +173,9 @@ py==1.10.0 # via # -r requirements/tox.txt # tox -pycodestyle==2.6.0 +pycodestyle==2.7.0 # via -r requirements/test.txt -pycryptodomex==3.9.9 +pycryptodomex==3.10.1 # via # -r requirements/test.txt # pyjwkest @@ -196,14 +194,14 @@ pylint-plugin-utils==0.6 # -r requirements/test.txt # pylint-celery # pylint-django -pylint==2.6.0 +pylint==2.7.2 # via # -r requirements/test.txt # edx-lint # pylint-celery # pylint-django # pylint-plugin-utils -pymongo==3.11.2 +pymongo==3.11.3 # via # -r requirements/test.txt # edx-opaque-keys @@ -221,7 +219,7 @@ python-slugify==4.0.1 # via # -r requirements/test.txt # code-annotations -pytz==2020.5 +pytz==2021.1 # via # -r requirements/test.txt # django @@ -249,7 +247,6 @@ six==1.15.0 # via # -r requirements/test.txt # -r requirements/tox.txt - # astroid # bleach # edx-lint # fs @@ -281,14 +278,14 @@ toml==0.10.2 # -r requirements/tox.txt # pylint # tox -tox==3.21.3 +tox==3.23.0 # via -r requirements/tox.txt urllib3==1.26.3 # via # -r requirements/test.txt # botocore # requests -virtualenv==20.4.0 +virtualenv==20.4.2 # via # -r requirements/tox.txt # tox @@ -301,7 +298,7 @@ webencodings==0.5.1 # via # -r requirements/test.txt # bleach -webob==1.8.6 +webob==1.8.7 # via # -r requirements/test.txt # xblock diff --git a/setup.py b/setup.py index 68b15fbad4537f89acd4c5220cd95f4754fa21c3..c9cedceed888b7f51acf428d60e43829c0bf9d03 100644 --- a/setup.py +++ b/setup.py @@ -49,7 +49,7 @@ with open('README.rst') as _f: setup( name='lti-consumer-xblock', - version='2.7.1', + version='2.7.2', description='This XBlock implements the consumer side of the LTI specification.', long_description=long_description, long_description_content_type='text/x-rst',