diff --git a/web-app/django/VIM/apps/instruments/error_codes.py b/web-app/django/VIM/apps/instruments/error_codes.py index 95738200..a237f299 100644 --- a/web-app/django/VIM/apps/instruments/error_codes.py +++ b/web-app/django/VIM/apps/instruments/error_codes.py @@ -49,7 +49,7 @@ class ErrorCode: ErrorCode.INVALID_LANGUAGE_CODE: "One or more language codes are invalid.", ErrorCode.INVALID_HBS_CLASSIFICATION: "Valid Hornbostel-Sachs classification (at least 2 digits) is required.", ErrorCode.INVALID_IMAGE_TYPE: "Invalid image type. Allowed types: JPEG, PNG, GIF, WebP.", - ErrorCode.INVALID_IMAGE_SIZE: "Image file size must be less than 5MB.", + ErrorCode.INVALID_IMAGE_SIZE: "Image file size must be less than 2MB.", ErrorCode.FIELD_TOO_LONG: "One or more fields exceed the maximum allowed length.", ErrorCode.INVALID_JSON_FORMAT: "Invalid data format. Please check your request and try again.", ErrorCode.DUPLICATE_NAME_IN_REQUEST: "Duplicate entries detected in your submission.", diff --git a/web-app/django/VIM/apps/instruments/utils/validators.py b/web-app/django/VIM/apps/instruments/utils/validators.py index 130e4685..3641a243 100644 --- a/web-app/django/VIM/apps/instruments/utils/validators.py +++ b/web-app/django/VIM/apps/instruments/utils/validators.py @@ -195,7 +195,7 @@ def validate_image_file(image_file) -> Tuple[bool, str]: # Check file size if image_file.size > settings.MAX_IMAGE_SIZE: - return False, "Image file size must be less than 5MB" + return False, "Image file size must be less than 2MB" # Check content type content_type = image_file.content_type diff --git a/web-app/django/VIM/settings.py b/web-app/django/VIM/settings.py index fdddcf27..d9868793 100644 --- a/web-app/django/VIM/settings.py +++ b/web-app/django/VIM/settings.py @@ -182,7 +182,7 @@ # Media files (user uploads & wikidata images) MEDIA_ROOT = ROOT_DIR / "media" MEDIA_URL = "/media/" -MAX_IMAGE_SIZE = 5 * 1024 * 1024 # 5MB +MAX_IMAGE_SIZE = 2 * 1024 * 1024 # 2MB # Default primary key field type # https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field diff --git a/web-app/django/VIM/templates/instruments/create.html b/web-app/django/VIM/templates/instruments/create.html index e070ae3b..ee9673a5 100644 --- a/web-app/django/VIM/templates/instruments/create.html +++ b/web-app/django/VIM/templates/instruments/create.html @@ -101,7 +101,7 @@