From 9e89082df2aaa15b6bebe7e37f5fe989ddd7254b Mon Sep 17 00:00:00 2001
From: Hivert Milo <milo.hivert@student-cs.fr>
Date: Mon, 5 Dec 2022 03:04:40 +0100
Subject: [PATCH] local fonctionnel

---
 .../__pycache__/views.cpython-310.pyc         | Bin 12561 -> 12503 bytes
 .../campagne/static/campagne/js/hotline.js    |   2 +-
 site_campagne/campagne/views.py               |   4 ++--
 .../__pycache__/settings.cpython-310.pyc      | Bin 2899 -> 2899 bytes
 site_campagne/site_campagne/settings.py       |   2 +-
 5 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/site_campagne/campagne/__pycache__/views.cpython-310.pyc b/site_campagne/campagne/__pycache__/views.cpython-310.pyc
index 2977b8d62046c3f9857809a894280bfa6694ab72..f57d570252815a70070490a1b14e1d6c0b25c6f2 100644
GIT binary patch
delta 79
zcmbQ3bUl$TpO=@5fq{XcG_W`MjO9kYICjQOlXKav1g-S-bMliDb29RaOROvm3=B43
UW#?oP6U`_oDZr3hEXbt}0KGgH;Q#;t

delta 137
zcmcbfI5CMYpO=@5fq{Wxu}5z*o7G0XICjSKlXKav^op(Y^%ILrQqwcjQcLoaK(t<R
vv2Jo=Zb50WURsfUW?o5ZQEqBVW@2Vh>gFBnoJ__>86_nJq-k7yol_kEVhS*y

diff --git a/site_campagne/campagne/static/campagne/js/hotline.js b/site_campagne/campagne/static/campagne/js/hotline.js
index 8aaecb19..717bb8f0 100644
--- a/site_campagne/campagne/static/campagne/js/hotline.js
+++ b/site_campagne/campagne/static/campagne/js/hotline.js
@@ -70,7 +70,7 @@ function f (){
             paraph.classList.add("text_box");
         }
         if (adresse!=="" && somme >0 && somme <= 40 ){
-            window.location = "https://astegifetobegif.cs-campus.fr/mes_commandes/"+nature+"_"+nutella+"_"+sucre+"_"+fraise+"_"+abricot+"_"+adresse+"_";
+            window.location = "http://localhost:8000/mes_commandes/"+nature+"_"+nutella+"_"+sucre+"_"+fraise+"_"+abricot+"_"+adresse+"_";
         }
     }
 }
diff --git a/site_campagne/campagne/views.py b/site_campagne/campagne/views.py
index 7086123a..f764aadd 100644
--- a/site_campagne/campagne/views.py
+++ b/site_campagne/campagne/views.py
@@ -28,13 +28,13 @@ def decryptmess(message):
 
 
 def connexion(request):
-    return HttpResponseRedirect('https://auth.viarezo.fr/oauth/authorize/?redirect_uri=https://astegifetobegif.cs-campus.fr/intermediaire&client_id=2fe828e15647fc92437727b6646ce5c799c40991&response_type=code&state=sqdkfjhsqdkf&scope=default')
+    return HttpResponseRedirect('https://auth.viarezo.fr/oauth/authorize/?redirect_uri=http://localhost:8000&client_id=2fe828e15647fc92437727b6646ce5c799c40991&response_type=code&state=sqdkfjhsqdkf&scope=default')
 
 def login(request): #on a le state et le authorization code dans le request
     code = str(request.GET['code']),
     state = str(request.GET['state'])
     url = 'https://auth.viarezo.fr/oauth/token'
-    redirect_url = 'https://astegifetobegif.cs-campus.fr/intermediaire'
+    redirect_url = 'http://localhost:8000'
     jso = requests.post(url, data={'grant_type':'authorization_code','code':code,'redirect_uri':redirect_url,'client_id':'2fe828e15647fc92437727b6646ce5c799c40991','client_secret':'f306614fc96833e80af693f2991901bc54a9cf9a'}).json()
     access_token = jso['access_token']
     r = requests.get("https://auth.viarezo.fr/api/user/show/me", headers={"Authorization" : "Bearer "+access_token})
diff --git a/site_campagne/site_campagne/__pycache__/settings.cpython-310.pyc b/site_campagne/site_campagne/__pycache__/settings.cpython-310.pyc
index 5fd6e62ff66ff332463d83101b6d8145e2ca2255..55734ca4ced6734dabb66c7b248f3ad8b40fea12 100644
GIT binary patch
delta 158
zcmcaCc3F%!pO=@5fq{WRIj}d`Zz6A2FiQ$oIztNgBF0R{6rMRO>5NglDZEj9DSRpX
zscb0%(hMnrbC@z2qxe&VQiL-ZQ-o4Pz@#Xc6w72xXNeL>5swl~k%$sXVTlq>k(_wS
zTv9ShK1DG~Aw?-lF-18_DMckpIfW%kB}H<x6ypR&#*odcnYx%Zo3U0gF}iKuz`mFn
E0DK`PvH$=8

delta 158
zcmcaCc3F%!pO=@5fq{YHm`882|3u!bV6GJIbcPh3MU0t@DZF!7(ix+8Q~09zQutE@
zQrS`jr5RF$<}hV4M)9Wzr-)=SrU<8qf=MwjDW1ug&Jrb%A`vB+A{ix=!WAW)!ZPuc
zxg<-Je2QX}LW)w9Vv2H<Qi@8Hatc?JN(#$nDaHwmjBcA(Gj%aBhHN%vtzz1|fqgME
E0MnHxF#rGn

diff --git a/site_campagne/site_campagne/settings.py b/site_campagne/site_campagne/settings.py
index 5b4ba96d..ac8f4785 100644
--- a/site_campagne/site_campagne/settings.py
+++ b/site_campagne/site_campagne/settings.py
@@ -24,7 +24,7 @@ SECRET_KEY = 'django-insecure-^pwp$p=!_g7hoyl&1kul+!v(!y9lu+6@-+1d_&auub18m^h@w(
 
 # SECURITY WARNING: don't run with debug turned on in production!
 
-DEBUG = False
+DEBUG = True
 
 
 ALLOWED_HOSTS = ["138.195.139.213", "localhost", "astegifetobegif.cs-campus.fr", "*"]
-- 
GitLab