uploads: Remove unusable UI elements if file uploading is disabled.

If MAX_FILE_UPLOAD_SIZE is set to 0, then UI elements like the upload
icon in the compose and message edit UI and "Attachments" menu in
"/#settings" are not displayed.
A different error message is also displayed if a user tries to drag and
drop or paste a file into the compose message box.

Fixes #12152.
This commit is contained in:
vinitS101
2019-05-04 23:54:36 +05:30
committed by Tim Abbott
parent ececf0a209
commit 18a424be79
8 changed files with 37 additions and 8 deletions

View File

@@ -304,6 +304,7 @@ def home_real(request: HttpRequest) -> HttpResponse:
'enable_feedback': settings.ENABLE_FEEDBACK,
'embedded': narrow_stream is not None,
'invite_as': PreregistrationUser.INVITE_AS,
'max_file_upload_size': settings.MAX_FILE_UPLOAD_SIZE,
},)
patch_cache_control(response, no_cache=True, no_store=True, must_revalidate=True)
return response