Skip to content

Commit

Permalink
Merge pull request #1740 from gtech-mulearn/dev
Browse files Browse the repository at this point in the history
school
adnankattekaden authored Dec 5, 2023
2 parents b0ebead + 16e77ee commit 9cb85cd
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions api/register/register_views.py
Original file line number Diff line number Diff line change
@@ -184,6 +184,24 @@ def post(self, request):
).get_success_response()


class SchoolAPI(APIView):
def post(self, request):
org_queryset = Organization.objects.filter(
Q(org_type=OrganizationType.SCHOOL.value),
Q(district_id=request.data.get("district")),
)

college_serializer_data = serializers.OrgSerializer(
org_queryset, many=True
).data

return CustomResponse(
response={
"schools": college_serializer_data,
}
).get_success_response()


class CommunityAPI(APIView):
def get(self, request):
community_queryset = Organization.objects.filter(
1 change: 1 addition & 0 deletions api/register/urls.py
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@
path("college/list/", register_views.CollegeAPI.as_view()),
path("company/list/", register_views.CompanyAPI.as_view()),
path("community/list/", register_views.CommunityAPI.as_view()),
path("schools/list/", register_views.SchoolAPI.as_view()),
path("area-of-interest/list/", register_views.AreaOfInterestAPI.as_view()),
path("lc/user-validation/", register_views.LearningCircleUserViewAPI.as_view()),
path('email-verification/', register_views.UserEmailVerificationAPI.as_view()),

0 comments on commit 9cb85cd

Please sign in to comment.