Commit 0cf0bb81 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg Committed by Luko van der Maas
Browse files

Update to Django 2.2

parent f77c801a
...@@ -8,8 +8,8 @@ variables: ...@@ -8,8 +8,8 @@ variables:
# Installs: # Installs:
# - pip: coverage, poetry # - pip: coverage, poetry
# - apt: ghostscript # - apt: ghostscript
PY36_IMAGE: thalia/python-thalia:3.6
PY37_IMAGE: thalia/python-thalia:3.7 PY37_IMAGE: thalia/python-thalia:3.7
PY38_IMAGE: thalia/python-thalia:3.8
PIP_CACHE_DIR: "${CI_PROJECT_DIR}/pip-cache" PIP_CACHE_DIR: "${CI_PROJECT_DIR}/pip-cache"
stages: stages:
...@@ -18,7 +18,7 @@ stages: ...@@ -18,7 +18,7 @@ stages:
codestyle: codestyle:
stage: test stage: test
image: $PY36_IMAGE image: $PY37_IMAGE
before_script: before_script:
- poetry install --no-interaction - poetry install --no-interaction
script: script:
...@@ -48,11 +48,7 @@ codestyle: ...@@ -48,11 +48,7 @@ codestyle:
- poetry run python -Wall -mcoverage run manage.py test - poetry run python -Wall -mcoverage run manage.py test
- coverage report - coverage report
python36-django21: python37-django22:
<<: *djangotest
image: $PY36_IMAGE
python37-django21:
<<: *djangotest <<: *djangotest
image: $PY37_IMAGE image: $PY37_IMAGE
after_script: after_script:
...@@ -62,6 +58,11 @@ python37-django21: ...@@ -62,6 +58,11 @@ python37-django21:
paths: paths:
- website/covhtml/ - website/covhtml/
python38-django22:
<<: *djangotest
image: $PY38_IMAGE
allow_failure: true
.sshsetup: &sshsetup .sshsetup: &sshsetup
before_script: before_script:
- mkdir -p ~/.ssh - mkdir -p ~/.ssh
...@@ -76,7 +77,7 @@ coverage deploy: ...@@ -76,7 +77,7 @@ coverage deploy:
stage: deploy stage: deploy
image: debian:stretch image: debian:stretch
dependencies: dependencies:
- python37-django21 - python37-django22
environment: environment:
name: coverage/${CI_COMMIT_REF_NAME} name: coverage/${CI_COMMIT_REF_NAME}
url: https://coverage.technicie.nl/${CI_COMMIT_REF_SLUG}/ url: https://coverage.technicie.nl/${CI_COMMIT_REF_SLUG}/
...@@ -109,7 +110,7 @@ coverage remove: ...@@ -109,7 +110,7 @@ coverage remove:
docs tests: docs tests:
stage: test stage: test
image: $PY36_IMAGE image: $PY37_IMAGE
before_script: before_script:
# install django deps # install django deps
- poetry install --no-interaction --extras "docs" - poetry install --no-interaction --extras "docs"
......
This diff is collapsed.
...@@ -6,46 +6,46 @@ authors = ["Thalia Technicie <www@thalia.nu>"] ...@@ -6,46 +6,46 @@ authors = ["Thalia Technicie <www@thalia.nu>"]
license = "AGPL-3.0-or-later" license = "AGPL-3.0-or-later"
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = "^3.6" python = "^3.7"
django-localflavor = "^2.1" django-localflavor = "~2.1"
freezegun = "^0.3.11" freezegun = "~0.3.11"
bleach = "^3.1" bleach = "~3.1"
django-tinymce4-lite = "^1.7" django-tinymce4-lite = "~1.7"
rcssmin = "^1.0" rcssmin = "~1.0"
djangorestframework = "^3.9" djangorestframework = "~3.9"
django-ical = "^1.5" django-ical = "~1.5"
django-libsass = "^0.7.0" django-libsass = "~0.7.0"
django-cors-headers = "^2.4" django-cors-headers = "~2.5"
python-magic = "^0.4.15" python-magic = "~0.4.15"
redis = "^3.2" redis = "~3.2"
Django = "^2.1" Django = "~2.2"
Pillow = "^5.4" Pillow = "~5.4"
django_compressor = "^2.2" django_compressor = "~2.2"
psycopg2-binary = "^2.7" psycopg2-binary = "~2.8"
bcrypt = "^3.1" bcrypt = "~3.1"
argon2_cffi = "^19.1" argon2_cffi = "~19.1"
uWSGI = "^2.0" uWSGI = "~2.0"
django-bootstrap4 = "^0.0.7" django-bootstrap4 = "~0.0.8"
firebase-admin = "^2.15" firebase-admin = "~2.15"
sentry-sdk = "^0.7.3" sentry-sdk = "~0.7.3"
django-sendfile2 = "^0.4.2" django-sendfile2 = "~0.4.2"
# docs requirements # docs requirements
recommonmark = { version = "^0.5.0", optional = true } recommonmark = { version = "~0.5.0", optional = true }
sphinx = { version = "^1.8", optional = true } sphinx = { version = "~1.8", optional = true }
[tool.poetry.extras] [tool.poetry.extras]
docs = ["recommonmark", "sphinx"] docs = ["recommonmark", "sphinx"]
[tool.poetry.dev-dependencies] [tool.poetry.dev-dependencies]
django-template-check = "^0.3.1" django-template-check = "~0.3.1"
factory_boy = "^2.11" factory_boy = "~2.11"
flake8 = "^3.7" flake8 = "~3.7"
pydenticon = "^0.3.1" pydenticon = "~0.3.1"
pylint = "^2.2" pylint = "~2.3"
pylint-django = "^2.0" pylint-django = "~2.0"
Faker = "^1.0" Faker = "~1.0"
coverage = "^4.5" coverage = "~4.5"
[build-system] [build-system]
requires = ["poetry>=0.12"] requires = ["poetry>=0.12"]
......
...@@ -21,7 +21,7 @@ class NextCloudUsersView(ListAPIView): ...@@ -21,7 +21,7 @@ class NextCloudUsersView(ListAPIView):
serializer_class = NextCloudMemberSerializer serializer_class = NextCloudMemberSerializer
def get_queryset(self): def get_queryset(self):
perm = Permission.objects.get(content_type__app_label='auth', perm = Permission.objects.get(content_type__app_label='members',
codename='nextcloud_admin') codename='nextcloud_admin')
return super().get_queryset().filter( return super().get_queryset().filter(
Q(pk__in=MemberGroupMembership.active_objects.values_list( Q(pk__in=MemberGroupMembership.active_objects.values_list(
...@@ -45,7 +45,7 @@ class NextCloudGroupsView(ListAPIView): ...@@ -45,7 +45,7 @@ class NextCloudGroupsView(ListAPIView):
def list(self, request, *args, **kwargs): def list(self, request, *args, **kwargs):
response = super().list(request, *args, **kwargs) response = super().list(request, *args, **kwargs)
perm = Permission.objects.get(content_type__app_label='auth', perm = Permission.objects.get(content_type__app_label='members',
codename='nextcloud_admin') codename='nextcloud_admin')
admin_users = Member.current_members.filter( admin_users = Member.current_members.filter(
Q(is_superuser=True) | Q(is_superuser=True) |
......
...@@ -11,5 +11,5 @@ class SentryIdentityPermission(permissions.BasePermission): ...@@ -11,5 +11,5 @@ class SentryIdentityPermission(permissions.BasePermission):
def has_permission(self, request, view): def has_permission(self, request, view):
if 'secret' in request.GET: if 'secret' in request.GET:
return (request.GET['secret'] == settings.MEMBERS_SENTRY_API_SECRET return (request.GET['secret'] == settings.MEMBERS_SENTRY_API_SECRET
and request.user.has_perm('auth.sentry_access')) and request.user.has_perm('members.sentry_access'))
return False return False
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment