Skip to content

Commit

Permalink
fix: remove parameter used for HTML output
Browse files Browse the repository at this point in the history
  • Loading branch information
AdriiiPRodri committed Feb 26, 2025
1 parent cf761ab commit f5f62f8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion api/src/backend/api/v1/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,7 @@ def destroy(self, request, *args, pk=None, **kwargs):
403: OpenApiResponse(description="There is a problem with credentials"),
404: OpenApiResponse(description="The scan has no reports"),
},
)
),
)
@method_decorator(CACHE_DECORATOR, name="list")
@method_decorator(CACHE_DECORATOR, name="retrieve")
Expand Down
12 changes: 9 additions & 3 deletions prowler/lib/outputs/html/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ def batch_write_data_to_file(self, provider: Provider, stats: dict) -> None:
and self._data
):
if self._file_descriptor.tell() == 0:
HTML.write_header(self._file_descriptor, provider, stats)
HTML.write_header(
self._file_descriptor, provider, stats, self._from_cli
)
for finding in self._data:
self._file_descriptor.write(finding)
if self.close_file or self._from_cli:
Expand All @@ -88,7 +90,10 @@ def batch_write_data_to_file(self, provider: Provider, stats: dict) -> None:

@staticmethod
def write_header(
file_descriptor: TextIOWrapper, provider: Provider, stats: dict
file_descriptor: TextIOWrapper,
provider: Provider,
stats: dict,
from_cli: bool = True,
) -> None:
"""
Writes the header of the HTML file.
Expand All @@ -97,6 +102,7 @@ def write_header(
file_descriptor (file): the file descriptor to write the header
provider (Provider): the provider object
stats (dict): the statistics of the findings
from_cli (bool): whether the request is from the CLI or not
"""
try:
file_descriptor.write(
Expand Down Expand Up @@ -154,7 +160,7 @@ def write_header(
</div>
</li>
<li class="list-group-item">
<b>Parameters used:</b> {" ".join(sys.argv[1:])}
<b>Parameters used:</b> {" ".join(sys.argv[1:]) if from_cli else ""}
</li>
<li class="list-group-item">
<b>Date:</b> {timestamp.isoformat()}
Expand Down

0 comments on commit f5f62f8

Please sign in to comment.