2020-12-07 16:06:14 +01:00
|
|
|
import json
|
|
|
|
|
|
|
|
from rest_framework import viewsets
|
|
|
|
from rest_framework.response import Response
|
|
|
|
|
|
|
|
from posthog.models.team import Team
|
2021-02-03 10:22:42 +01:00
|
|
|
from posthog.utils import get_safe_cache
|
2020-12-07 16:06:14 +01:00
|
|
|
|
|
|
|
|
|
|
|
class DebugCHQueries(viewsets.ViewSet):
|
|
|
|
"""
|
|
|
|
Show recent queries for this user
|
|
|
|
"""
|
|
|
|
|
|
|
|
def list(self, request):
|
2021-02-03 10:22:42 +01:00
|
|
|
return Response(json.loads(get_safe_cache("save_query_{}".format(request.user.pk)) or "[]"))
|
2020-12-07 16:06:14 +01:00
|
|
|
|
|
|
|
def get(self, request):
|
|
|
|
return Response([{"hey": "hi"}])
|