Retrieves a specific report object by job_id and report_id. Overrides the drf's default `get_object` method to fetch a report object based on job_id and report_id, and checks the permissions for the object. Args: job_id (int): The ID of the job associat
(self, job_id: int, report_id: int)
| 1016 | return self.report_model.objects.all() |
| 1017 | |
| 1018 | def get_object(self, job_id: int, report_id: int) -> AbstractReport: |
| 1019 | """ |
| 1020 | Retrieves a specific report object by job_id and report_id. |
| 1021 | |
| 1022 | Overrides the drf's default `get_object` method to fetch a report object |
| 1023 | based on job_id and report_id, and checks the permissions for the object. |
| 1024 | |
| 1025 | Args: |
| 1026 | job_id (int): The ID of the job associated with the report. |
| 1027 | report_id (int): The ID of the report. |
| 1028 | |
| 1029 | Returns: |
| 1030 | AbstractReport: The report object. |
| 1031 | |
| 1032 | Raises: |
| 1033 | NotFound: If the report does not exist. |
| 1034 | """ |
| 1035 | try: |
| 1036 | obj = self.report_model.objects.get( |
| 1037 | job_id=job_id, |
| 1038 | pk=report_id, |
| 1039 | ) |
| 1040 | except self.report_model.DoesNotExist: |
| 1041 | raise NotFound() |
| 1042 | else: |
| 1043 | self.check_object_permissions(self.request, obj) |
| 1044 | return obj |
| 1045 | |
| 1046 | @staticmethod |
| 1047 | def perform_kill(report: AbstractReport): |
no test coverage detected