Skip to content

Commit a594749

Browse files
Merge pull request #43 from metallicgloss/correct_validation_length
Resolve station name validation.
2 parents 2aecd3c + 4811ba4 commit a594749

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

underground_route_planner/templates/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ <h2 class="header-block-subheading mb-0">Find the shortest path for your request
1919
<div class="row">
2020
<div class="col-lg-3">
2121
<p class="selection-title from-title">From</p>
22-
<input type="text" name="origin-location" id="origin-location" placeholder="Origin Location" />
22+
<input type="text" name="origin-location" id="origin-location" placeholder="Origin Location" style="width: 100%;" />
2323
</div>
2424
<div class="col-lg-3">
2525
<p class="selection-title to-title">To</p>
26-
<input type="text" name="destination-location" id="destination-location" placeholder="Destination Location" />
26+
<input type="text" name="destination-location" id="destination-location" placeholder="Destination Location" style="width: 100%;" />
2727
</div>
2828
<div class="col-lg-2">
2929
<p class="selection-title at-title">At</p>

underground_route_planner/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def route_search(request):
5959
)
6060

6161
# Simple check to ensure parameter is string and within length limits.
62-
if((not isinstance(value[1], str)) or (3 > len(value[1])) or (25 < len(value[1])) or (value[1] is None) or (value[1] == "")):
62+
if((not isinstance(value[1], str)) or (3 >= len(value[1])) or (27 <= len(value[1])) or (value[1] is None) or (value[1] == "")):
6363
# Return invalid message
6464
return JsonResponse(
6565
{

0 commit comments

Comments
 (0)