Fix self.teacher was None

This commit is contained in:
Gabriel Augendre 2019-05-28 12:53:10 +02:00 committed by GitHub
parent 9807433fe8
commit cfbee2b0dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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