Skip to content

Commit c785334

Browse files
committed
PEP8ify
1 parent 91712f7 commit c785334

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

hello/views.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,17 @@ def get_context_data(self, **kwargs):
1616
context = super(HomeListView, self).get_context_data(**kwargs)
1717
return context
1818

19+
1920
def about(request):
2021
"""Renders the about page."""
2122
return render(request, "hello/about.html")
2223

24+
2325
def contact(request):
2426
"""Renders the contact page."""
2527
return render(request, "hello/contact.html")
2628

29+
2730
def hello_there(request, name):
2831
"""Renders the hello_there page.
2932
Args:
@@ -33,15 +36,14 @@ def hello_there(request, name):
3336
request, "hello/hello_there.html", {"name": name, "date": datetime.now()}
3437
)
3538

39+
3640
def log_message(request):
41+
form = LogMessageForm(request.POST or None)
3742
if request.method == "POST":
38-
form = LogMessageForm(request.POST)
39-
4043
if form.is_valid():
4144
message = form.save(commit=False)
4245
message.log_date = datetime.now()
4346
message.save()
4447
return redirect("home")
4548
else:
46-
form = LogMessageForm()
4749
return render(request, "hello/log_message.html", {"form": form})

0 commit comments

Comments
 (0)