Skip to content

Commit

Permalink
Merge pull request #2154 from gtech-mulearn/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
jelanmathewjames authored Jul 10, 2024
2 parents 9590c29 + ce1b24d commit cb8c55d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions api/launchpad/launchpad_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,7 @@ def get(self, request):

class BaseAPI(APIView):
def get_authenticated_user(self, request, launchpad_id):
data = request.data
auth_mail = data.pop('current_user', None)
auth_mail = request.query_params.get('current_user', None)
auth_mail = auth_mail[0] if isinstance(auth_mail, list) else auth_mail
if launchpad_id is None:
return None, CustomResponse(general_message="No launchpad id provided").get_failure_response()
Expand All @@ -553,7 +552,7 @@ def get_authenticated_user(self, request, launchpad_id):
except LaunchPad.DoesNotExist:
return None, CustomResponse(general_message="Invalid Launchpad ID").get_failure_response()
return user, None

class UserProfileAPI(BaseAPI):
def get(self, request, launchpad_id=None):
user, response = self.get_authenticated_user(request, launchpad_id)
Expand Down
8 changes: 4 additions & 4 deletions api/launchpad/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
path('user-college-data/', launchpad_views.UserBasedCollegeData.as_view()),
path('bulk-user-college-link/', launchpad_views.BulkLaunchpadUser.as_view()),
path('list-participants-admin/', launchpad_views.LaunchPadListAdmin.as_view()),
path('user-profile/<str:launch_id>/', launchpad_views.UserProfileAPI.as_view()),
path('socials/<str:launch_id>/', launchpad_views.GetSocialsAPI.as_view()),
path('user-log/<str:launch_id>/', launchpad_views.UserLogAPI.as_view()),
path('get-user-levels/<str:launch_id>/', launchpad_views.UserLevelsAPI.as_view()),
path('user-details/<str:launchpad_id>/', launchpad_views.UserProfileAPI.as_view()),
path('socials/<str:launchpad_id>/', launchpad_views.GetSocialsAPI.as_view()),
path('user-log/<str:launchpad_id>/', launchpad_views.UserLogAPI.as_view()),
path('get-user-levels/<str:launchpad_id>/', launchpad_views.UserLevelsAPI.as_view()),
]

0 comments on commit cb8c55d

Please sign in to comment.