Skip to content

Commit 7a3eabe

Browse files
committed
remove print statements and formatting
1 parent f8845d9 commit 7a3eabe

File tree

10 files changed

+8
-16
lines changed

10 files changed

+8
-16
lines changed

api/auth/controller.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33

44
def create_account(username, numeric_identifier, auth_level="student"):
55
account_id = db.create_account(username, numeric_identifier)
6-
print(auth_level)
76
db.add_to_roster(account_id, auth_level)
87
return account_id

api/database/relational_db/relational_db.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,5 +139,3 @@ def add_to_roster(self, user_id, role):
139139
""",
140140
(role, user_id),
141141
)
142-
143-

api/database/relational_db/relational_db_accounts.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ def sign_up(self, username, pw) -> str | None:
120120
(hashed, auth, username),
121121
).fetchone()
122122

123-
124123
if not auth_token:
125124
return None
126125

api/database/relational_db/relational_db_cursor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ def __enter__(self):
1212

1313
def __exit__(self, exc_type, exc_value, traceback):
1414
self.connection.commit()
15-
self.connection.close()
15+
self.connection.close()

api/queue/controller.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
from api.database.db import db
22

3+
34
def decode_pn(raw):
45
try:
56
return raw.split("/^")[1][14:22]
67
except Exception:
78
return ""
89

10+
911
def add_to_queue_by_card_swipe(swipe_data):
1012
pn = decode_pn(swipe_data)
1113
student = db.lookup_person_number(pn)

api/queue/routes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ def get_anon_queue():
187187
if entry["id"] == user_id:
188188
return {"position": i}
189189

190-
191190
return {"message": "You are not in the queue!"}, 400
192191

193192

api/server.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import api.utils.debug_routes as debug_routes
2121

2222

23-
2423
def create_app():
2524
"""Create and return Flask API server
2625
@@ -63,11 +62,11 @@ def queue():
6362
if not (user := db.get_authenticated_user(auth_token)):
6463
return redirect("/login")
6564

66-
if user["course_role"] == 'student':
65+
if user["course_role"] == "student":
6766
return render_template("student_queue.html")
6867
return render_template("instructor_queue.html")
6968

70-
@app.route('/jimmy', methods=["GET"])
69+
@app.route("/jimmy", methods=["GET"])
7170
def jimmy():
7271
if not (auth_token := request.cookies.get("auth_token")):
7372
return ""
@@ -77,8 +76,6 @@ def jimmy():
7776

7877
return user
7978

80-
81-
8279
@app.route("/favicon.ico", methods=["GET"])
8380
@debug_access_only
8481
def favicon():

api/utils/debug.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
from flask import current_app, abort, request, Blueprint
55

66

7-
8-
97
# Referenced: https://stackoverflow.com/a/55729767
108
def debug_access_only(func):
119
"""Limit route access to debug mode only, return 404 if access outside of debug mode"""
@@ -17,4 +15,3 @@ def wrapped(**kwargs):
1715
return abort(404)
1816

1917
return wrapped
20-

api/utils/debug_routes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
blueprint = Blueprint("debug", __name__)
77

8+
89
@blueprint.route("/force-enroll", methods=["POST"])
910
@debug_access_only
1011
def force_enroll():
@@ -16,7 +17,6 @@ def force_enroll():
1617
if role not in {"student", "ta", "instructor", "admin"}:
1718
return {"message": "Invalid role"}, 400
1819

19-
print(role)
2020
user_id = create_account(ubit, pn, role)
2121

22-
return {"message": "Successfully enrolled", "id": user_id}
22+
return {"message": "Successfully enrolled", "id": user_id}

tests/auth/test_permissions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
{"username": "horse", "pn": "154345345"},
2020
]
2121

22+
2223
@pytest.fixture
2324
def test_db():
2425
db.filename = "testing.sqlite"

0 commit comments

Comments
 (0)