Spaces:
Runtime error
Runtime error
Commit
•
6b5e27e
1
Parent(s):
2c11b57
remove sub
Browse files- .coverage +0 -0
- app/requirements.txt +1 -0
- app/routers/friend_request.py +0 -7
- app/routers/video.py +0 -4
.coverage
CHANGED
Binary files a/.coverage and b/.coverage differ
|
|
app/requirements.txt
CHANGED
@@ -11,5 +11,6 @@ uvicorn==0.23.2
|
|
11 |
python-multipart==0.0.6
|
12 |
firebase_admin==6.2.0
|
13 |
pytest
|
|
|
14 |
qrcode==7.4.2
|
15 |
neo4j==5.14.1
|
|
|
11 |
python-multipart==0.0.6
|
12 |
firebase_admin==6.2.0
|
13 |
pytest
|
14 |
+
pytest-cov
|
15 |
qrcode==7.4.2
|
16 |
neo4j==5.14.1
|
app/routers/friend_request.py
CHANGED
@@ -24,8 +24,6 @@ EXPIRE_MINUTES = 15
|
|
24 |
|
25 |
@router.get("")
|
26 |
def getFriendRequest(current_user=Depends(get_current_user)):
|
27 |
-
if current_user["sub"] is None:
|
28 |
-
return HTTPException(status_code=400, detail="User not found")
|
29 |
friend_requests = (
|
30 |
db.collection(COLLECTION_NAME)
|
31 |
.where("inviter", "==", current_user["sub"])
|
@@ -41,8 +39,6 @@ def getFriendRequest(current_user=Depends(get_current_user)):
|
|
41 |
|
42 |
@router.post("")
|
43 |
def createRequest(user=Depends(get_current_user)):
|
44 |
-
if user["sub"] is None:
|
45 |
-
raise HTTPException(status_code=400, detail="User not found")
|
46 |
_, fr_ref = db.collection(COLLECTION_NAME).add(
|
47 |
{
|
48 |
"inviter": user["sub"],
|
@@ -66,9 +62,6 @@ def createRequest(user=Depends(get_current_user)):
|
|
66 |
|
67 |
@router.patch("/{RequestId}")
|
68 |
async def acceptRequest(RequestId: str, user=Depends(get_current_user)):
|
69 |
-
if user["sub"] is None:
|
70 |
-
raise HTTPException(status_code=400, detail="User not found")
|
71 |
-
|
72 |
fr_ref = db.collection(COLLECTION_NAME).document(RequestId)
|
73 |
fr = fr_ref.get()
|
74 |
|
|
|
24 |
|
25 |
@router.get("")
|
26 |
def getFriendRequest(current_user=Depends(get_current_user)):
|
|
|
|
|
27 |
friend_requests = (
|
28 |
db.collection(COLLECTION_NAME)
|
29 |
.where("inviter", "==", current_user["sub"])
|
|
|
39 |
|
40 |
@router.post("")
|
41 |
def createRequest(user=Depends(get_current_user)):
|
|
|
|
|
42 |
_, fr_ref = db.collection(COLLECTION_NAME).add(
|
43 |
{
|
44 |
"inviter": user["sub"],
|
|
|
62 |
|
63 |
@router.patch("/{RequestId}")
|
64 |
async def acceptRequest(RequestId: str, user=Depends(get_current_user)):
|
|
|
|
|
|
|
65 |
fr_ref = db.collection(COLLECTION_NAME).document(RequestId)
|
66 |
fr = fr_ref.get()
|
67 |
|
app/routers/video.py
CHANGED
@@ -40,10 +40,6 @@ async def handleVideoRequest(
|
|
40 |
)
|
41 |
|
42 |
try:
|
43 |
-
if user["sub"] is None:
|
44 |
-
return HTTPException(
|
45 |
-
status_code=status.HTTP_400_BAD_REQUEST, detail="User not found"
|
46 |
-
)
|
47 |
id = str(now())
|
48 |
_, artifact_ref = db.collection("artifacts").add(
|
49 |
{"name": id + ".mp4", "status": "pending"}
|
|
|
40 |
)
|
41 |
|
42 |
try:
|
|
|
|
|
|
|
|
|
43 |
id = str(now())
|
44 |
_, artifact_ref = db.collection("artifacts").add(
|
45 |
{"name": id + ".mp4", "status": "pending"}
|