Skip to content

Commit

Permalink
fixup: fix parameter type and name
Browse files Browse the repository at this point in the history
  • Loading branch information
juho-kettunen-nc committed Feb 4, 2025
1 parent c18451a commit 426da03
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions filescan/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,18 @@ def scan_result(self) -> FileScanResult:

@staticmethod
def filefield_latest_scan_result(
fieldfile_instance: PrivateFieldFile,
file_object: models.Model,
) -> FileScanResult:
if settings.FLAG_FILE_SCAN is False:
# Feature is not enabled, all files are considered safe.
return FileScanResult.SAFE

# Find the latest filescan status for this file
content_type = ContentType.objects.get_for_model(fieldfile_instance)
content_type = ContentType.objects.get_for_model(file_object)
scan_status = (
FileScanStatus.objects.filter(
content_type=content_type,
object_id=fieldfile_instance.pk,
object_id=file_object.pk,
)
.order_by("id")
.last()
Expand All @@ -96,7 +96,7 @@ def filefield_latest_scan_result(
# The file has not yet been queued for a virus scan.
# Consider if this branch should raise an error.
logger.warning(
f"FileScanStatus not found for object {fieldfile_instance.pk} of contenttype {content_type}"
f"FileScanStatus not found for object {file_object.pk} of contenttype {content_type}"
)
return FileScanResult.PENDING

Expand Down

0 comments on commit 426da03

Please sign in to comment.