From efd92e996766df717c260e4891022a58510ef89f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Delobelle?= Date: Sat, 24 Sep 2016 19:31:50 +0200 Subject: [PATCH 1/3] Fix protection autocomplete --- kfet/autocomplete.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kfet/autocomplete.py b/kfet/autocomplete.py index e4203bd1..2a24a51e 100644 --- a/kfet/autocomplete.py +++ b/kfet/autocomplete.py @@ -8,8 +8,10 @@ from django.shortcuts import render from django.http import Http404 from django.db.models import Q from gestioncof.models import User, Clipper +from kfet.decorators import teamkfet_required from kfet.models import Account +@teamkfet_required def account_create(request): if "q" not in request.GET: raise Http404 From 54409fb85f458c9220554c51305a99c9521a712e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Sat, 24 Sep 2016 19:34:36 +0200 Subject: [PATCH 2/3] Modif pour la production --- apache/__init__.py | 0 apache/django.wsgi | 7 ------- apache/wsgi.py | 18 ------------------ cof/asgi.py | 3 ++- 4 files changed, 2 insertions(+), 26 deletions(-) delete mode 100644 apache/__init__.py delete mode 100644 apache/django.wsgi delete mode 100644 apache/wsgi.py diff --git a/apache/__init__.py b/apache/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/apache/django.wsgi b/apache/django.wsgi deleted file mode 100644 index 7b9c271d..00000000 --- a/apache/django.wsgi +++ /dev/null @@ -1,7 +0,0 @@ -import os, sys -sys.path.append (os.path.expanduser ('~gestion/www')) -os.environ['DJANGO_SETTINGS_MODULE'] = 'cof.settings' - -import django.core.handlers.wsgi - -application = django.core.handlers.wsgi.WSGIHandler() diff --git a/apache/wsgi.py b/apache/wsgi.py deleted file mode 100644 index 177542a8..00000000 --- a/apache/wsgi.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- - -""" -WSGI config for myproject project. -It exposes the WSGI callable as a module-level variable named ``application``. -For more information on this file, see -https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/ -""" - -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - -import os -from django.core.wsgi import get_wsgi_application - -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cof.settings") -application = get_wsgi_application() diff --git a/cof/asgi.py b/cof/asgi.py index bb1b3b83..a34621c7 100644 --- a/cof/asgi.py +++ b/cof/asgi.py @@ -1,6 +1,7 @@ import os from channels.asgi import get_channel_layer -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cof.settings_dev") +if "DJANGO_SETTINGS_MODULE" not in os.environ: + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cof.settings") channel_layer = get_channel_layer() From 68153652d03988fa07fa2dc88604a74106ff2dd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Sat, 24 Sep 2016 19:40:16 +0200 Subject: [PATCH 3/3] Protection de la vue autocomplete --- gestioncof/autocomplete.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gestioncof/autocomplete.py b/gestioncof/autocomplete.py index 5b4616be..ed0a1e5a 100644 --- a/gestioncof/autocomplete.py +++ b/gestioncof/autocomplete.py @@ -10,8 +10,10 @@ from django.db.models import Q from django.contrib.auth.models import User from gestioncof.models import CofProfile, Clipper +from gestioncof.decorators import buro_required +@buro_required def autocomplete(request): if "q" not in request.GET: raise Http404