En fait tout était public, oups

This commit is contained in:
Evarin 2017-05-16 22:56:19 +02:00
parent 2d36898bc4
commit bcb5d35dd1

View file

@ -32,17 +32,17 @@ def perso(request):
# Profil # Profil
#login_required #login_required
class ProfilView(DetailView, LoginRequiredMixin): class ProfilView(LoginRequiredMixin, DetailView):
model = Normalien model = Normalien
template_name = 'avisstage/detail/profil.html' template_name = 'avisstage/detail/profil.html'
# Récupération de son propre profil # Récupération du profil
def get_object(self): def get_object(self):
return Normalien.objects.get(user__username=self.kwargs.get('username')) return Normalien.objects.get(user__username=self.kwargs.get('username'))
# Stage # Stage
#login_required #login_required
class StageView(DetailView, LoginRequiredMixin): class StageView(LoginRequiredMixin, DetailView):
model = Stage model = Stage
template_name = 'avisstage/detail/stage.html' template_name = 'avisstage/detail/stage.html'
@ -53,7 +53,7 @@ class StageView(DetailView, LoginRequiredMixin):
# Liste des stages par dernière modification # Liste des stages par dernière modification
#login_required #login_required
class StageListe(ListView, LoginRequiredMixin): class StageListe(LoginRequiredMixin, ListView):
model = Stage model = Stage
template_name = 'avisstage/liste/stage.html' template_name = 'avisstage/liste/stage.html'
@ -75,7 +75,7 @@ def faq(request):
# Profil # Profil
#login_required #login_required
class ProfilEdit(UpdateView, LoginRequiredMixin): class ProfilEdit(LoginRequiredMixin, UpdateView):
model = Normalien model = Normalien
fields = ['nom', 'promotion', 'mail', 'contactez_moi', 'bio'] fields = ['nom', 'promotion', 'mail', 'contactez_moi', 'bio']
template_name = 'avisstage/formulaires/profil.html' template_name = 'avisstage/formulaires/profil.html'
@ -180,7 +180,7 @@ def save_lieu(request):
else: else:
return JsonResponse({"erreur": "Aucune donnée POST"}) return JsonResponse({"erreur": "Aucune donnée POST"})
class LieuAjout(CreateView, LoginRequiredMixin): class LieuAjout(LoginRequiredMixin, CreateView):
model = Lieu model = Lieu
form_class = LieuForm form_class = LieuForm
template_name = 'avisstage/formulaires/lieu.html' template_name = 'avisstage/formulaires/lieu.html'