Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
tusd: Use upload failure message similar to one in compose upload.
Aman Agrawal5a5660fcbfdb
diff --git a/zerver/tests/test_tusd.py b/zerver/tests/test_tusd.pyindex 3681295e2d7..6bcf2463cd5 100644--- a/zerver/tests/test_tusd.py+++ b/zerver/tests/test_tusd.py@@ -455,7 +455,7 @@ class TusdPreCreateTest(ZulipTestCase):self.assertEqual(orjson.loads(result_json["HttpResponse"]["Body"]),{- "message": f"Uploaded file is larger than the allowed limit of {settings.MAX_WEB_DATA_IMPORT_SIZE_MB} MiB"+ "message": f"Uploaded file exceeds the maximum file size for imports ({settings.MAX_WEB_DATA_IMPORT_SIZE_MB} MiB)."},)self.assertEqual(result_json["RejectUpload"], True)diff --git a/zerver/views/tusd.py b/zerver/views/tusd.pyindex 2f993637278..abb73b4a36b 100644--- a/zerver/views/tusd.py+++ b/zerver/views/tusd.py@@ -262,9 +262,9 @@ def handle_preregistration_pre_create_hook(return reject_upload("SizeIsDeferred is not supported", 411)if data.size > max_upload_size:return reject_upload(- _("Uploaded file is larger than the allowed limit of {max_file_size} MiB").format(- max_file_size=settings.MAX_WEB_DATA_IMPORT_SIZE_MB- ),+ _(+ "Uploaded file exceeds the maximum file size for imports ({max_file_size} MiB)."+ ).format(max_file_size=settings.MAX_WEB_DATA_IMPORT_SIZE_MB),413,)