File tree 3 files changed +9
-1
lines changed
3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,9 @@ def intializeDB():
26
26
27
27
def search_index (request ):
28
28
intializeDB ()
29
+ if not request .session .has_key ('username' ):
30
+ request .session ['alert' ] = "Please login to create a ride."
31
+ return redirect ('index' )
29
32
all_rides = list (ridesDB .find ())
30
33
processed = list ()
31
34
for ride in all_rides :
Original file line number Diff line number Diff line change 48
48
< h1 class ="display-4 apply-font " style ="color: white; "> PackTravel</ h1 >
49
49
< p class ="lead " style ="color: white; "> Travel safely with a pack. Find rides or book a new ride.</ p >
50
50
< 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 %}
52
56
< a type ="button " class ="btn btn-dark apply-font " href ="/search/ "> Search for Rides</ a >
53
57
< a type ="button " class ="btn btn-dark apply-font " style ="margin-left: 5px; " href ="/publish/ "> Publish a New Ride</ a >
58
+ {% endif %}
54
59
</ div >
55
60
</ div >
56
61
</ div >
You can’t perform that action at this time.
0 commit comments