Exemplo n.º 1
0
 def get(self, request, pk):
     public_barrier = PublicBarrier.objects.get(barrier_id=self.kwargs.get("pk"))
     history_items = HistoryManager.get_public_activity(public_barrier=public_barrier, use_cache=False)
     response = {
         "barrier_id": str(pk),
         "history": [item.data for item in history_items],
     }
     return Response(response, status=status.HTTP_200_OK)
Exemplo n.º 2
0
 def get(self, request, pk):
     barrier = Barrier.objects.get(id=self.kwargs.get("pk"))
     history_items = HistoryManager.get_full_history(
         barrier=barrier,
         ignore_creation_items=True,
         use_cache=True,
     )
     response = {
         "barrier_id": str(pk),
         "history": [item.data for item in history_items],
     }
     return Response(response, status=status.HTTP_200_OK)
Exemplo n.º 3
0
 def get(self, request, pk):
     barrier = Barrier.objects.get(id=self.kwargs.get("pk"))
     history_items = HistoryManager.get_full_history(
         # TODO: MAR-1068 - Re-enable use_cache=True - Temporarily disabled due to
         # not caching action plans history entries correctly
         barrier=barrier,
         ignore_creation_items=True,
         use_cache=False,
     )
     response = {
         "barrier_id": str(pk),
         "history": [item.data for item in history_items],
     }
     return Response(response, status=status.HTTP_200_OK)
 def generate_history_for_barrier(self, barrier):
     history_items = HistoryManager.get_full_history(barrier)
     for item in history_items:
         CachedHistoryItem.create_from_history_item(item)