Fix self.teacher was None
This commit is contained in:
parent
9807433fe8
commit
cfbee2b0dd
1 changed files with 1 additions and 1 deletions
|
@ -72,7 +72,7 @@ class ItemView(BaseTeacherView):
|
||||||
|
|
||||||
def dispatch(self, request, *args, **kwargs):
|
def dispatch(self, request, *args, **kwargs):
|
||||||
response = super().dispatch(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.")
|
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 redirect('list_books', pk=self.teacher.pk)
|
||||||
return response
|
return response
|
||||||
|
|
Loading…
Reference in a new issue