mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-04-10 18:18:50 +00:00
Docstrings
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user