From e197f259c7bd64815c1735173a3176fac8a4e86d Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Fri, 10 Apr 2026 11:17:46 -0700 Subject: [PATCH] Docstrings --- src/paperless/serialisers.py | 4 ++++ src/paperless/validators.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/paperless/serialisers.py b/src/paperless/serialisers.py index af9a3c511..fafbb914c 100644 --- a/src/paperless/serialisers.py +++ b/src/paperless/serialisers.py @@ -256,6 +256,10 @@ class ApplicationConfigurationSerializer(serializers.ModelSerializer): image.close() def validate_app_logo(self, file: UploadedFile): + """ + Validates and sanitizes the uploaded app logo image. Model field already restricts to + jpg/png/gif/svg see src/paperless/models.py#L200 + """ if not file: return file diff --git a/src/paperless/validators.py b/src/paperless/validators.py index 5de9f972d..eaa590a38 100644 --- a/src/paperless/validators.py +++ b/src/paperless/validators.py @@ -264,7 +264,7 @@ def validate_raster_image(file: UploadedFile) -> None: """ Validates that the uploaded file is a valid raster image (JPEG, PNG, etc.) and does not exceed maximum pixel limits. - Raises ValidationError if the image is invalid or potentially dangerous. + Raises ValidationError if the image is invalid or exceeds the allowed size. """ file.seek(0)