Skip to content

Commit

Permalink
Refactor LaunchPadListAdmin get method to use query_params instead of…
Browse files Browse the repository at this point in the history
… request.data
  • Loading branch information
SharonAliyas5573 committed Jul 11, 2024
1 parent b48a210 commit 8e1c5bc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions api/launchpad/launchpad_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,8 +478,7 @@ def post(self, request):
class LaunchPadListAdmin(APIView):

def get(self, request):
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 not (auth_user := LaunchPadUsers.objects.filter(email=auth_mail, role=LaunchPadRoles.ADMIN.value).first()):
return CustomResponse(general_message="Unauthorized").get_failure_response()
Expand Down

0 comments on commit 8e1c5bc

Please sign in to comment.