mirror of
https://github.com/PostHog/posthog.git
synced 2024-12-01 04:12:23 +01:00
16 lines
401 B
Python
16 lines
401 B
Python
import json
|
|
|
|
from rest_framework import mixins, viewsets
|
|
from rest_framework.response import Response
|
|
|
|
from posthog.utils import get_safe_cache
|
|
|
|
|
|
class DebugCHQueries(mixins.ListModelMixin, viewsets.GenericViewSet):
|
|
"""
|
|
Show recent queries for this user
|
|
"""
|
|
|
|
def list(self, request):
|
|
return Response(json.loads(get_safe_cache("save_query_{}".format(request.user.pk)) or "[]"))
|