Skip to content

Commit 7cadee8

Browse files
authored
Merge pull request #9 from mohi7solanki/patch-1
Render errors if form is not valid
2 parents 91712f7 + aa46535 commit 7cadee8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

hello/views.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ def log_message(request):
4242
message.log_date = datetime.now()
4343
message.save()
4444
return redirect("home")
45+
else:
46+
return render(request, "hello/log_message.html", {"form": form})
4547
else:
4648
form = LogMessageForm()
4749
return render(request, "hello/log_message.html", {"form": form})

0 commit comments

Comments
 (0)