From 99c4b00b269fda71c4dcc694a7e67708b6a1e940 Mon Sep 17 00:00:00 2001 From: Kazuaki Ueda Date: Mon, 2 Sep 2024 17:17:50 +0900 Subject: [PATCH] #575 update entry id --- django-diary/source_code_step_5/entries/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django-diary/source_code_step_5/entries/views.py b/django-diary/source_code_step_5/entries/views.py index 93ac80b9fc..8f887d1eb6 100644 --- a/django-diary/source_code_step_5/entries/views.py +++ b/django-diary/source_code_step_5/entries/views.py @@ -30,7 +30,7 @@ class EntryUpdateView(UpdateView): fields = ["title", "content"] def get_success_url(self): - return reverse_lazy("entry-detail", kwargs={"pk": self.entry.id}) + return reverse_lazy("entry-detail", kwargs={"pk": self.object.pk}) class EntryDeleteView(DeleteView):