Add size limit for uploading user avatars and realm icons.

- Add settings parameter for max realm icon size.
- Add settings parameter for max user avatar size.
- Add checking file size to avatar and icon
  uploading views.
- Transfer file size limit parameter to frontend.
- Add tests.
This commit is contained in:
K.Kanakhin
2017-03-06 11:22:28 +06:00
committed by Tim Abbott
parent 01129c1ab9
commit 1cb0f8dc41
10 changed files with 53 additions and 9 deletions

View File

@@ -116,6 +116,8 @@ DEFAULT_SETTINGS = {'TWITTER_CONSUMER_KEY': '',
'S3_AVATAR_BUCKET': '',
'LOCAL_UPLOADS_DIR': None,
'MAX_FILE_UPLOAD_SIZE': 25,
'MAX_AVATAR_FILE_SIZE': 5,
'MAX_ICON_FILE_SIZE': 5,
'ERROR_REPORTING': True,
'BROWSER_ERROR_REPORTING': False,
'STAGING_ERROR_NOTIFICATIONS': False,