Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Krrupa committed Jan 22, 2024
1 parent dcbca3f commit 213d846
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
34 changes: 18 additions & 16 deletions app/id_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,25 +88,27 @@ def dedupe_for_users(parameters):
}
)
)

# check if any of the found students study in the school
for student in does_student_already_exist:
does_enrollment_record_exist = (
enrollment_record.get_enrollment_record(
build_request(
query_params={
"school_id": school_id_response[0]["id"],
"student_id": student["id"],
"grade": parameters["grade"],
}
if len(school_id_response) > 0:
# check if any of the found students study in the school
for student in does_student_already_exist:
does_enrollment_record_exist = (
enrollment_record.get_enrollment_record(
build_request(
query_params={
"school_id": school_id_response["id"],
"student_id": student["id"],
"grade": parameters["grade"],
}
)
)
)
)

if len(does_enrollment_record_exist) == 0:
return [False, ""]
else:
return [True, student["student_id"]]
if len(does_enrollment_record_exist) == 0:
return [False, ""]
else:
return [True, student["student_id"]]
else:
raise HTTPException(status_code=404, detail="School does not exist!")


def get_class_code(grade):
Expand Down
4 changes: 1 addition & 3 deletions app/router/student.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,11 @@ async def create_student(request: Request):
group_data = group.get_group_data(
build_request(query_params={"name": data["group"]})
)

# get group-type ID
response = requests.get(
routes.group_type_db_url,
params={
"child_id": group_data[0]["id"],
"child_id": group_data["id"],
"type": "group",
},
headers=db_request_token(),
Expand Down Expand Up @@ -394,7 +393,6 @@ async def create_student(request: Request):
}
)
)

query_params["school_id"] = school_id_response[0]["id"]

# create a new enrollment record for the student, based on the student ID and school ID
Expand Down

0 comments on commit 213d846

Please sign in to comment.