Skip to content

Commit 1ffddc5

Browse files
committed
routing correction
1 parent ab5e734 commit 1ffddc5

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

db.sqlite3

0 Bytes
Binary file not shown.

search/views.py

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ def intializeDB():
2626

2727
def search_index(request):
2828
intializeDB()
29+
if not request.session.has_key('username'):
30+
request.session['alert'] = "Please login to create a ride."
31+
return redirect('index')
2932
all_rides = list(ridesDB.find())
3033
processed = list()
3134
for ride in all_rides:

templates/home/home.html

+6-1
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,14 @@
4848
<h1 class="display-4 apply-font" style="color: white;">PackTravel</h1>
4949
<p class="lead" style="color: white;">Travel safely with a pack. Find rides or book a new ride.</p>
5050
<br>
51-
<div class="btn-group btn-group-lg" role="group" aria-label="Basic example">
51+
<div class="btn-group btn-group-lg" role="group">
52+
{% if not request.session.username %}
53+
<a type="button" class="btn btn-dark apply-font" href="/login/">Login</a>
54+
<a type="button" class="btn btn-dark apply-font" style="margin-left: 5px;" href="/register/">Sign Up</a>
55+
{% else %}
5256
<a type="button" class="btn btn-dark apply-font" href="/search/">Search for Rides</a>
5357
<a type="button" class="btn btn-dark apply-font" style="margin-left: 5px;" href="/publish/">Publish a New Ride</a>
58+
{% endif %}
5459
</div>
5560
</div>
5661
</div>

0 commit comments

Comments
 (0)