mirror of
https://github.com/ansible/awx.git
synced 2026-02-14 17:50:02 -03:30
Depend on a serializer context variable no_truncate
to decide whether to turn off the ANSI control sequence-aware truncation, instead of needing inappropriate awareness of the details of the view that invoked the serializer. This will also allow us to have views that can more flexibly turn off the truncation under other circumstances.
This commit is contained in:
@@ -3774,6 +3774,11 @@ class JobEventDetail(RetrieveAPIView):
|
||||
model = models.JobEvent
|
||||
serializer_class = serializers.JobEventSerializer
|
||||
|
||||
def get_serializer_context(self):
|
||||
context = super().get_serializer_context()
|
||||
context.update(no_truncate=True)
|
||||
return context
|
||||
|
||||
|
||||
class JobEventChildrenList(SubListAPIView):
|
||||
|
||||
@@ -4008,6 +4013,11 @@ class AdHocCommandEventDetail(RetrieveAPIView):
|
||||
model = models.AdHocCommandEvent
|
||||
serializer_class = serializers.AdHocCommandEventSerializer
|
||||
|
||||
def get_serializer_context(self):
|
||||
context = super().get_serializer_context()
|
||||
context.update(no_truncate=True)
|
||||
return context
|
||||
|
||||
|
||||
class BaseAdHocCommandEventsList(SubListAPIView):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user