Skip to content

Commit

Permalink
Merge pull request #2177 from gtech-mulearn/dev-server
Browse files Browse the repository at this point in the history
Dev server
  • Loading branch information
jelanmathewjames authored Jul 14, 2024
2 parents bfb5ccf + 00888c6 commit c75a0f2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions api/launchpad/launchpad_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,11 +591,17 @@ def get(self, request, launchpad_id=None):

class UserLogAPI(BaseAPI):
def get(self, request, launchpad_id=None):
launchpad_log = request.query_params.get('launchpad_log', False)
user, response = self.get_authenticated_user(request, launchpad_id)
if response:
return response
karma_activity_log = KarmaActivityLog.objects.filter(user=user.id, appraiser_approved=True).order_by("-created_at")
if not karma_activity_log:

query = Q(user=user.id, appraiser_approved=True)
if launchpad_log:
query &= Q(task__event='launchpad')
karma_activity_log = KarmaActivityLog.objects.filter(query).order_by("-created_at")
if not karma_activity_log.exists():
return CustomResponse(general_message="No karma details available for user").get_success_response()

serializer = UserLogSerializer(karma_activity_log, many=True)
return CustomResponse(response=serializer.data).get_success_response()

0 comments on commit c75a0f2

Please sign in to comment.