summaryrefslogtreecommitdiff
path: root/fbin/file_storage/exceptions.py
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2019-12-07 11:14:01 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2019-12-07 11:14:01 +0100
commitf1cfaef5b0f358c94fe7f5e7c2eb5a6d261a85ae (patch)
tree5828d85f02868311d4e9d5f1842a1f6c9b80d5e9 /fbin/file_storage/exceptions.py
parente52a152b16e51c329a281f144864d846bcacdde6 (diff)
Add max file size configuration
This allows configuring max file sizes for both registered and anonymous users. For registered users the USER_FILE_SIZE_LIMIT is used, and ANONYMOUS_FILE_SIZE_LIMIT for anonymous users. If the size is not specified or None, the limit is not enforced. Setting the limit to 0 effectively disables uploads.
Diffstat (limited to 'fbin/file_storage/exceptions.py')
-rw-r--r--fbin/file_storage/exceptions.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/fbin/file_storage/exceptions.py b/fbin/file_storage/exceptions.py
new file mode 100644
index 0000000..140221b
--- /dev/null
+++ b/fbin/file_storage/exceptions.py
@@ -0,0 +1,2 @@
+class StorageError(Exception): pass
+class FileSizeError(StorageError): pass