From cfbee2b0ddec0d6d83b56444943868e411ddf48a Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Tue, 28 May 2019 12:53:10 +0200 Subject: [PATCH] Fix self.teacher was None --- manuels/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manuels/views.py b/manuels/views.py index 47d6f29..deb760b 100644 --- a/manuels/views.py +++ b/manuels/views.py @@ -72,7 +72,7 @@ class ItemView(BaseTeacherView): def dispatch(self, request, *args, **kwargs): response = super().dispatch(request, *args, **kwargs) - if self.teacher.has_confirmed_list: + if self.teacher and self.teacher.has_confirmed_list: messages.error(request, "Vous avez déjà confirmé vos listes. Il n'est plus possible de les modifier.") return redirect('list_books', pk=self.teacher.pk) return response