Skip to content

Commit 459347a

Browse files
authored
Update hello_there.html
Added in logic so that "Name" is not required. If name is not supplied then a message is displayed.
1 parent 3546f38 commit 459347a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

hello_app/templates/hello_there.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
<title>Hello, Flask</title>
77
</head>
88
<body>
9-
<span class="message">Hello there, {{ name }}!</span> It's {{ date.strftime("%A, %d %B, %Y at %X") }}.
9+
{%if name %}
10+
<span class="message">Hello there, {{ name }}!</span> It's {{ date.strftime("%A, %d %B, %Y at %X") }}.
11+
{% else %}
12+
<span class="message">You must provide a name.</span>
13+
{% endif %}
1014
</body>
1115
</html>
1216
<!-- The above syntax makes use of jinja and it's documentation can be found over here http://jinja.pocoo.org/docs/2.10/templates/ -->

0 commit comments

Comments
 (0)