-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackend.py
More file actions
91 lines (78 loc) · 2.67 KB
/
Copy pathbackend.py
File metadata and controls
91 lines (78 loc) · 2.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
from flask import Blueprint, current_app, jsonify, redirect, request, url_for, render_template
import survey_logic
form_api = Blueprint("form", __name__, url_prefix="")
@form_api.route("/form", methods=["GET"])
def form_show():
"""Show user the login page
"""
return render_template('form.html'), 200
@form_api.route("/")
def home_create():
return render_template("home.html")
@form_api.route("/form", methods=["POST"])
def form_create():
"""Attempts to authorize the user
"""
print(request.form)
mentor_name = survey_logic.my_data(request.form)
mentor1 = {
'id': 'Laurel',
'name': 'Laurel Hitchens',
'position': 'Architect',
'interests': 'Math, I love working in teams!, I prefer to use a logical approach, From home',
'className': 'Laurel',
'imageURL': "Architect.jpg"
}
mentor2 = {
'id': 'Benjamin',
'name': 'Benjamin Stewart',
'position': 'Website Designer',
'interests': 'Arts, I prefer to work alone, I prefer to go with my gut, From home',
'className': 'Benjamin',
'imageURL': "Web Designer.jpg"
}
mentor3 = {
'id': 'Steven',
'name': 'Steven Marrow',
'position': 'College History Professor',
'interests': 'English, Working in teams is okay, I prefer to go with my gut, In an office',
'className': 'Steven',
'imageURL': "Prof.jpg"
}
mentor4 = {
'id': 'Sarah',
'name': 'Sarah Powers',
'position': 'Product Manager',
'interests': 'Math, I love working in teams!, I prefer to use a logical approach, In an office',
'className': 'Sarah',
'imageURL': "Product Manager.jpeg"
}
mentor5 = {
'id': 'Amanda',
'name': 'Amanda Herrings',
'position': 'Auto Repair Mechanic',
'interests': 'Science, Working in teams is okay, I prefer to use a logical appraoch, Outside',
'className': 'Amanda',
'imageURL': "Mechanic.jpeg"
}
mentor6 = {
'id': 'Joshua',
'name': 'Joshua Argus',
'position': 'Dietician',
'interests': 'Science, I prefer to work alone, I prefer to go with my gut, In an office',
'className': 'Joshua',
'imageURL': "Dietician.jpg"
}
if mentor_name == mentor1['id']:
mentor = mentor1
elif mentor_name == mentor2['id']:
mentor = mentor2
elif mentor_name == mentor3['id']:
mentor = mentor3
elif mentor_name == mentor4['id']:
mentor = mentor4
elif mentor_name == mentor5['id']:
mentor = mentor5
else:
mentor = mentor6
return render_template('index.html', mentor=mentor), 200