diff --git a/ccvpn/views.py b/ccvpn/views.py index 307ac62..7310c07 100644 --- a/ccvpn/views.py +++ b/ccvpn/views.py @@ -49,13 +49,10 @@ def set_lang(request): response = http.HttpResponseRedirect(next) lang_code = request.GET.get('lang', None) if lang_code and check_for_language(lang_code): - if hasattr(request, 'session'): - request.session[LANGUAGE_SESSION_KEY] = lang_code - else: - response.set_cookie(settings.LANGUAGE_COOKIE_NAME, lang_code, - max_age=settings.LANGUAGE_COOKIE_AGE, - path=settings.LANGUAGE_COOKIE_PATH, - domain=settings.LANGUAGE_COOKIE_DOMAIN) + response.set_cookie(settings.LANGUAGE_COOKIE_NAME, lang_code, + max_age=settings.LANGUAGE_COOKIE_AGE, + path=settings.LANGUAGE_COOKIE_PATH, + domain=settings.LANGUAGE_COOKIE_DOMAIN) return response diff --git a/poetry.lock b/poetry.lock index 5890587..85d07ae 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,3 +1,14 @@ +[[package]] +category = "main" +description = "ASGI specs, helper code, and adapters" +name = "asgiref" +optional = false +python-versions = ">=3.5" +version = "3.2.10" + +[package.extras] +tests = ["pytest", "pytest-asyncio"] + [[package]] category = "dev" description = "An abstract syntax tree for Python with inference support." @@ -45,10 +56,11 @@ category = "main" description = "A high-level Python Web framework that encourages rapid development and clean, pragmatic design." name = "django" optional = false -python-versions = ">=3.5" -version = "2.2.14" +python-versions = ">=3.6" +version = "3.0.8" [package.dependencies] +asgiref = ">=3.2,<4.0" pytz = "*" sqlparse = ">=0.2.2" @@ -70,7 +82,7 @@ description = "Django live settings with pluggable backends, including Redis." name = "django-constance" optional = false python-versions = "*" -version = "2.4.0" +version = "2.7.0" [package.dependencies] [package.dependencies.django-picklefield] @@ -87,12 +99,12 @@ description = "Provides a country field for Django models." name = "django-countries" optional = false python-versions = "*" -version = "5.3.3" +version = "6.1.2" [package.extras] -dev = ["tox", "django", "pytest", "pytest-django"] +dev = ["tox", "black", "django", "pytest", "pytest-django", "djangorestframework", "graphene-django"] maintainer = ["transifex-client", "zest.releaser", "django"] -test = ["pytest", "pytest-django", "pytest-cov"] +test = ["pytest", "pytest-django", "pytest-cov", "graphene-django"] [[package]] category = "main" @@ -156,6 +168,22 @@ optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" version = "2.10" +[[package]] +category = "main" +description = "Read metadata from Python packages" +marker = "python_version < \"3.8\"" +name = "importlib-metadata" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" +version = "1.7.0" + +[package.dependencies] +zipp = ">=0.5" + +[package.extras] +docs = ["sphinx", "rst.linker"] +testing = ["packaging", "pep517", "importlib-resources (>=1.3)"] + [[package]] category = "dev" description = "A Python utility / library to sort Python imports." @@ -206,11 +234,13 @@ category = "main" description = "Python implementation of Markdown." name = "markdown" optional = false -python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*" -version = "3.1" +python-versions = ">=3.5" +version = "3.2.2" [package.dependencies] -setuptools = ">=36" +[package.dependencies.importlib-metadata] +python = "<3.8" +version = "*" [package.extras] testing = ["coverage", "pyyaml"] @@ -274,7 +304,7 @@ description = "A Pylint plugin to help Pylint understand the Django web framewor name = "pylint-django" optional = false python-versions = "*" -version = "2.0.15" +version = "2.1.0" [package.dependencies] pylint = ">=2.0" @@ -301,15 +331,15 @@ description = "The Swiss Army Knife of the Bitcoin protocol." name = "python-bitcoinlib" optional = false python-versions = "*" -version = "0.10.2" +version = "0.11.0" [[package]] category = "main" -description = "Parse and manage posts with YAML frontmatter" +description = "Parse and manage posts with YAML (or other) frontmatter" name = "python-frontmatter" optional = false python-versions = "*" -version = "0.4.5" +version = "0.5.0" [package.dependencies] PyYAML = "*" @@ -321,7 +351,7 @@ description = "World timezone definitions, modern and historical" name = "pytz" optional = false python-versions = "*" -version = "2019.3" +version = "2020.1" [[package]] category = "main" @@ -371,7 +401,7 @@ description = "Python bindings for the Stripe API" name = "stripe" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "2.48.0" +version = "2.49.0" [package.dependencies] [package.dependencies.requests] @@ -416,11 +446,28 @@ optional = false python-versions = "*" version = "1.12.1" +[[package]] +category = "main" +description = "Backport of pathlib-compatible object wrapper for zip files" +marker = "python_version < \"3.8\"" +name = "zipp" +optional = false +python-versions = ">=3.6" +version = "3.1.0" + +[package.extras] +docs = ["sphinx", "jaraco.packaging (>=3.2)", "rst.linker (>=1.9)"] +testing = ["jaraco.itertools", "func-timeout"] + [metadata] -content-hash = "a98242fc2af13b27de7ba7ead354679785a5856752b460fce1d675123af463f7" -python-versions = "^3.5" +content-hash = "22e6b3c34d0d34295899ba2aca1f916916b922321a021a28a5e519ef05c02aa4" +python-versions = "^3.6" [metadata.files] +asgiref = [ + {file = "asgiref-3.2.10-py3-none-any.whl", hash = "sha256:9fc6fb5d39b8af147ba40765234fa822b39818b12cc80b35ad9b0cef3a476aed"}, + {file = "asgiref-3.2.10.tar.gz", hash = "sha256:7e51911ee147dd685c3c8b805c0ad0cb58d360987b56953878f8c06d2d1c6f1a"}, +] astroid = [ {file = "astroid-2.4.2-py3-none-any.whl", hash = "sha256:bc58d83eb610252fd8de6363e39d4f1d0619c894b0ed24603b881c02e64c7386"}, {file = "astroid-2.4.2.tar.gz", hash = "sha256:2f4078c2a41bf377eea06d71c9d2ba4eb8f6b1af2135bec27bbbb7d8f12bb703"}, @@ -438,20 +485,20 @@ colorama = [ {file = "colorama-0.4.3.tar.gz", hash = "sha256:e96da0d330793e2cb9485e9ddfd918d456036c7149416295932478192f4436a1"}, ] django = [ - {file = "Django-2.2.14-py3-none-any.whl", hash = "sha256:f2250bd35d0f6c23e930c544629934144e5dd39a4c06092e1050c731c1712ba8"}, - {file = "Django-2.2.14.tar.gz", hash = "sha256:edf0ecf6657713b0435b6757e6069466925cae70d634a3283c96b80c01e06191"}, + {file = "Django-3.0.8-py3-none-any.whl", hash = "sha256:5457fc953ec560c5521b41fad9e6734a4668b7ba205832191bbdff40ec61073c"}, + {file = "Django-3.0.8.tar.gz", hash = "sha256:31a5fbbea5fc71c99e288ec0b2f00302a0a92c44b13ede80b73a6a4d6d205582"}, ] django-admin-list-filter-dropdown = [ {file = "django-admin-list-filter-dropdown-1.0.3.tar.gz", hash = "sha256:07cd37b6a9be1b08f11d4a92957c69b67bc70b1f87a2a7d4ae886c93ea51eb53"}, {file = "django_admin_list_filter_dropdown-1.0.3-py3-none-any.whl", hash = "sha256:bf1b48bab9772dad79db71efef17e78782d4f2421444d5e49bb10e0da71cd6bb"}, ] django-constance = [ - {file = "django-constance-2.4.0.tar.gz", hash = "sha256:417f9866a4fcd93c198acd16d5bc22b68e491eaabb18efea4c70d183d42daa45"}, - {file = "django_constance-2.4.0-py2.py3-none-any.whl", hash = "sha256:19ff1ae8295aeffc2917ab67da4b310bfaf8c42f34d570f89e289fd54c4217b0"}, + {file = "django-constance-2.7.0.tar.gz", hash = "sha256:62bdb1a3aef20d80e18d832b30ffcc6626762c538817a5a3571bcefa5a55c849"}, + {file = "django_constance-2.7.0-py3-none-any.whl", hash = "sha256:866a7356d3f8ee08374285e97c1edae70edaa3df6eaf7b2e9699f7cde8a88f3b"}, ] django-countries = [ - {file = "django-countries-5.3.3.tar.gz", hash = "sha256:5307a61172eee5740720e44ea08721858b7d8bf8509ec7701ccd7a8d21120b9a"}, - {file = "django_countries-5.3.3-py2.py3-none-any.whl", hash = "sha256:e4eaaec9bddb9365365109f833d1fd0ecc0cfee3348bf5441c0ccefb2d6917cd"}, + {file = "django-countries-6.1.2.tar.gz", hash = "sha256:e2ae9b76f9a0b5f3f365b5b81fe4972df0a5878c930139586f43f7d6d50a9594"}, + {file = "django_countries-6.1.2-py3-none-any.whl", hash = "sha256:2e852c9693818d64d28758a720a0cb8277673ac495af8b855c4dc64940703bd2"}, ] django-jsonfield = [ {file = "django-jsonfield-1.4.0.tar.gz", hash = "sha256:9b3dac9f7352a6d37e9cfe0126c5b58ac7abf1cb20c0da294a00269a725223f1"}, @@ -470,6 +517,10 @@ idna = [ {file = "idna-2.10-py2.py3-none-any.whl", hash = "sha256:b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0"}, {file = "idna-2.10.tar.gz", hash = "sha256:b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6"}, ] +importlib-metadata = [ + {file = "importlib_metadata-1.7.0-py2.py3-none-any.whl", hash = "sha256:dc15b2969b4ce36305c51eebe62d418ac7791e9a157911d58bfb1f9ccd8e2070"}, + {file = "importlib_metadata-1.7.0.tar.gz", hash = "sha256:90bb658cdbbf6d1735b6341ce708fc7024a3e14e99ffdc5783edea9f9b077f83"}, +] isort = [ {file = "isort-4.3.21-py2.py3-none-any.whl", hash = "sha256:6e811fcb295968434526407adb8796944f1988c5b65e8139058f2014cbe100fd"}, {file = "isort-4.3.21.tar.gz", hash = "sha256:54da7e92468955c4fceacd0c86bd0ec997b0e1ee80d97f67c35a78b719dccab1"}, @@ -502,8 +553,8 @@ lazy-object-proxy = [ ] lcoreapi = [] markdown = [ - {file = "Markdown-3.1-py2.py3-none-any.whl", hash = "sha256:fe463ff51e679377e3624984c829022e2cfb3be5518726b06f608a07a3aad680"}, - {file = "Markdown-3.1.tar.gz", hash = "sha256:fc4a6f69a656b8d858d7503bda633f4dd63c2d70cf80abdc6eafa64c4ae8c250"}, + {file = "Markdown-3.2.2-py3-none-any.whl", hash = "sha256:c467cd6233885534bf0fe96e62e3cf46cfc1605112356c4f9981512b8174de59"}, + {file = "Markdown-3.2.2.tar.gz", hash = "sha256:1fafe3f1ecabfb514a5285fca634a53c1b32a81cb0feb154264d55bf2ff22c17"}, ] mccabe = [ {file = "mccabe-0.6.1-py2.py3-none-any.whl", hash = "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42"}, @@ -554,25 +605,24 @@ pylint = [ {file = "pylint-2.5.3.tar.gz", hash = "sha256:7dd78437f2d8d019717dbf287772d0b2dbdfd13fc016aa7faa08d67bccc46adc"}, ] pylint-django = [ - {file = "pylint-django-2.0.15.tar.gz", hash = "sha256:06a64331c498a3f049ba669dc0c174b92209e164198d43e589b1096ee616d5f8"}, - {file = "pylint_django-2.0.15-py3-none-any.whl", hash = "sha256:3d3436ba8d0fae576ae2db160e33a8f2746a101fda4463f2b3ff3a8b6fccec38"}, + {file = "pylint-django-2.1.0.tar.gz", hash = "sha256:b7756844dba0cecd3471056a1ef4154439defedaba38bf3ced9f848d2bf6297c"}, + {file = "pylint_django-2.1.0-py3-none-any.whl", hash = "sha256:ca32277c77878dd3c2d9e75f3f3f7f0c0712f053f10ff1b946cdc27367a6c911"}, ] pylint-plugin-utils = [ {file = "pylint-plugin-utils-0.6.tar.gz", hash = "sha256:57625dcca20140f43731311cd8fd879318bf45a8b0fd17020717a8781714a25a"}, {file = "pylint_plugin_utils-0.6-py3-none-any.whl", hash = "sha256:2f30510e1c46edf268d3a195b2849bd98a1b9433229bb2ba63b8d776e1fc4d0a"}, ] python-bitcoinlib = [ - {file = "python-bitcoinlib-0.10.2.tar.gz", hash = "sha256:bdb270ded594b8dead58fd6830ad14f880c25ec1fd2ca1be24e9e85decefce04"}, - {file = "python_bitcoinlib-0.10.2-py2-none-any.whl", hash = "sha256:5df2777f4b47dc4f3e63ee02fd92ac3cc06d79a9fd6a2284c8d345cd8e750d25"}, - {file = "python_bitcoinlib-0.10.2-py3-none-any.whl", hash = "sha256:2fe94e8a947285b59de3fd6e16c9fd5312afb5dbaff6511eb361e3a858e7af57"}, + {file = "python-bitcoinlib-0.11.0.tar.gz", hash = "sha256:3daafd63cb755f6e2067b7c9c514053856034c9f9363c80c37007744d54a2e06"}, + {file = "python_bitcoinlib-0.11.0-py3-none-any.whl", hash = "sha256:6e7982734637135599e2136d3c88d622f147e3b29201636665f799365784cd9e"}, ] python-frontmatter = [ - {file = "python-frontmatter-0.4.5.tar.gz", hash = "sha256:cec75b2afd1a06cf5b03cfd9c5173365d3dc14379526389a9742ff35846df771"}, - {file = "python_frontmatter-0.4.5-py3-none-any.whl", hash = "sha256:13a61749910f2e1968c011103406429abc79c41d52b69adfb07f702ae2df32cc"}, + {file = "python-frontmatter-0.5.0.tar.gz", hash = "sha256:a9c2e90fc38e9f0c68d8b82299040f331ca3b8525ac7fa5f6beffef52b26c426"}, + {file = "python_frontmatter-0.5.0-py3-none-any.whl", hash = "sha256:a7dcdfdaf498d488dce98bfa9452f8b70f803a923760ceab1ebd99291d98d28a"}, ] pytz = [ - {file = "pytz-2019.3-py2.py3-none-any.whl", hash = "sha256:1c557d7d0e871de1f5ccd5833f60fb2550652da6be2693c1e02300743d21500d"}, - {file = "pytz-2019.3.tar.gz", hash = "sha256:b02c06db6cf09c12dd25137e563b31700d3b80fcc4ad23abb7a315f2789819be"}, + {file = "pytz-2020.1-py2.py3-none-any.whl", hash = "sha256:a494d53b6d39c3c6e44c3bec237336e14305e4f29bbf800b599253057fbb79ed"}, + {file = "pytz-2020.1.tar.gz", hash = "sha256:c35965d010ce31b23eeb663ed3cc8c906275d6be1a34393a1d73a41febf4a048"}, ] pyyaml = [ {file = "PyYAML-5.3.1-cp27-cp27m-win32.whl", hash = "sha256:74809a57b329d6cc0fdccee6318f44b9b8649961fa73144a98735b0aaf029f1f"}, @@ -600,8 +650,8 @@ sqlparse = [ {file = "sqlparse-0.3.1.tar.gz", hash = "sha256:e162203737712307dfe78860cc56c8da8a852ab2ee33750e33aeadf38d12c548"}, ] stripe = [ - {file = "stripe-2.48.0-py2.py3-none-any.whl", hash = "sha256:bdbbea632b8faa983c670db61debbe0bdb5802ef98fd0613a03aa466e56cdade"}, - {file = "stripe-2.48.0.tar.gz", hash = "sha256:515fe2cc915e639468f30150a39c162fc0fb090256ae9d6a04e5022925d136f1"}, + {file = "stripe-2.49.0-py2.py3-none-any.whl", hash = "sha256:77daf7af9a43d2f5b5ba36c65367a03c8e11057f868cb9ceee103043b3e7059c"}, + {file = "stripe-2.49.0.tar.gz", hash = "sha256:89331e81f8849631dac7b0772092605a74d8b48b15a78a6e483681d301a5af81"}, ] toml = [ {file = "toml-0.10.1-py2.py3-none-any.whl", hash = "sha256:bda89d5935c2eac546d648028b9901107a595863cb36bae0c73ac804a9b4ce88"}, @@ -637,3 +687,7 @@ urllib3 = [ wrapt = [ {file = "wrapt-1.12.1.tar.gz", hash = "sha256:b62ffa81fb85f4332a4f609cab4ac40709470da05643a082ec1eb88e6d9b97d7"}, ] +zipp = [ + {file = "zipp-3.1.0-py3-none-any.whl", hash = "sha256:aa36550ff0c0b7ef7fa639055d797116ee891440eac1a56f378e2d3179e0320b"}, + {file = "zipp-3.1.0.tar.gz", hash = "sha256:c599e4d75c98f6798c509911d08a22e6c021d074469042177c8c86fb92eefd96"}, +] diff --git a/pyproject.toml b/pyproject.toml index b983be8..cc26edf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,21 +5,21 @@ description = "" authors = ["CCrypto "] [tool.poetry.dependencies] -python = "^3.5" -django = "^2.2" +python = "^3.6" +django = "^3.0" django-jsonfield = "^1.1" -django_countries = "=5.3.3" -markdown = "=3.1" +django_countries = "^6.1.2" +markdown = "^3.1" requests = "^2.21" pygal = "^2.4" -pytz = "^2019.1" -python-bitcoinlib = "^0.10.1" +pytz = "^2020.1" +python-bitcoinlib = "^0.11" stripe = "^2.24" -django-constance = {version = "=2.4",extras = ["database"]} +django-constance = {version = "^2.7",extras = ["database"]} lcoreapi = {git = "https://git.packetimpact.net/lvpn/lcoreapi.git", tag = "v1.1.1"} pygments = "^2.3" psycopg2-binary = "^2.8" -python-frontmatter = "^0.4.5" +python-frontmatter = "^0.5.0" django-tinymce4-lite = "^1.7" django-admin-list-filter-dropdown = "^1.0" django-lcore = {git = "https://git.packetimpact.net/lvpn/django-lcore.git", tag = "v1.4.1"} diff --git a/templates/account_layout.html b/templates/account_layout.html index c55364d..9de0e9b 100644 --- a/templates/account_layout.html +++ b/templates/account_layout.html @@ -1,7 +1,7 @@ {% extends 'layout.html' %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% block content %}
diff --git a/templates/base_help.html b/templates/base_help.html index ba07132..f91e4a6 100644 --- a/templates/base_help.html +++ b/templates/base_help.html @@ -1,6 +1,6 @@ {% extends 'layout.html' %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% block content %}
diff --git a/templates/ccvpn/chat.html b/templates/ccvpn/chat.html index d93d98b..442b7a8 100644 --- a/templates/ccvpn/chat.html +++ b/templates/ccvpn/chat.html @@ -1,6 +1,6 @@ {% extends 'layout.html' %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% block wrap %} diff --git a/templates/ccvpn/index.html b/templates/ccvpn/index.html index da3b19c..0b81bb0 100644 --- a/templates/ccvpn/index.html +++ b/templates/ccvpn/index.html @@ -1,6 +1,6 @@ {% extends 'layout.html' %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% block headers %} diff --git a/templates/ccvpn/page.html b/templates/ccvpn/page.html index e072876..e2747c1 100644 --- a/templates/ccvpn/page.html +++ b/templates/ccvpn/page.html @@ -1,6 +1,6 @@ {% extends 'base_help.html' %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% block helpdesk_body %} {{ content|safe }} diff --git a/templates/ccvpn/require_email.html b/templates/ccvpn/require_email.html index df6f2c1..f1f392a 100644 --- a/templates/ccvpn/require_email.html +++ b/templates/ccvpn/require_email.html @@ -1,6 +1,6 @@ {% extends 'layout.html' %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% block content %}
diff --git a/templates/ccvpn/signup.html b/templates/ccvpn/signup.html index 3aec750..998ac04 100644 --- a/templates/ccvpn/signup.html +++ b/templates/ccvpn/signup.html @@ -1,6 +1,6 @@ {% extends 'layout.html' %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% block content %}
diff --git a/templates/lambdainst/account.html b/templates/lambdainst/account.html index c992e78..a048a05 100644 --- a/templates/lambdainst/account.html +++ b/templates/lambdainst/account.html @@ -1,6 +1,6 @@ {% extends 'account_layout.html' %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% block headers %} {% endblock %} diff --git a/templates/lambdainst/config.html b/templates/lambdainst/config.html index ad411b6..dbcd70f 100644 --- a/templates/lambdainst/config.html +++ b/templates/lambdainst/config.html @@ -1,6 +1,6 @@ {% extends 'account_layout.html' %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% block account_content %}
diff --git a/templates/lambdainst/settings.html b/templates/lambdainst/settings.html index 0163e7e..0041940 100644 --- a/templates/lambdainst/settings.html +++ b/templates/lambdainst/settings.html @@ -1,6 +1,6 @@ {% extends 'account_layout.html' %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% block account_content_outer %}