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