Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev server #2177

Merged
merged 7 commits into from
Jul 14, 2024
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()
Loading