Skip to content

Commit a63c5de

Browse files
authored
Merge pull request #10 from karansthr/master
PEP8ify
2 parents 5b073ff + c785334 commit a63c5de

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,10 +36,10 @@ 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()
@@ -45,5 +48,4 @@ def log_message(request):
4548
else:
4649
return render(request, "hello/log_message.html", {"form": form})
4750
else:
48-
form = LogMessageForm()
4951
return render(request, "hello/log_message.html", {"form": form})

0 commit comments

Comments
 (0)