File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -16,14 +16,17 @@ def get_context_data(self, **kwargs):
16
16
context = super (HomeListView , self ).get_context_data (** kwargs )
17
17
return context
18
18
19
+
19
20
def about (request ):
20
21
"""Renders the about page."""
21
22
return render (request , "hello/about.html" )
22
23
24
+
23
25
def contact (request ):
24
26
"""Renders the contact page."""
25
27
return render (request , "hello/contact.html" )
26
28
29
+
27
30
def hello_there (request , name ):
28
31
"""Renders the hello_there page.
29
32
Args:
@@ -33,15 +36,14 @@ def hello_there(request, name):
33
36
request , "hello/hello_there.html" , {"name" : name , "date" : datetime .now ()}
34
37
)
35
38
39
+
36
40
def log_message (request ):
41
+ form = LogMessageForm (request .POST or None )
37
42
if request .method == "POST" :
38
- form = LogMessageForm (request .POST )
39
-
40
43
if form .is_valid ():
41
44
message = form .save (commit = False )
42
45
message .log_date = datetime .now ()
43
46
message .save ()
44
47
return redirect ("home" )
45
48
else :
46
- form = LogMessageForm ()
47
49
return render (request , "hello/log_message.html" , {"form" : form })
You can’t perform that action at this time.
0 commit comments