File tree 4 files changed +16
-5
lines changed
4 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -86,11 +86,11 @@ def clean(self):
86
86
87
87
kind = self .cleaned_data .get ("kind" )
88
88
rel_message = self .cleaned_data .get ("rel_message" )
89
- if kind == "NEW" and rel_message :
89
+ ''' if kind == "NEW" and rel_message:
90
90
self.add_error(
91
91
"rel_message",
92
92
_("You cannot add a related message when message kind is New!"),
93
- )
93
+ )'''
94
94
if kind != "NEW" and not rel_message :
95
95
self .add_error (
96
96
"rel_message" ,
Original file line number Diff line number Diff line change 38
38
{% block extra_script_no_compress %}
39
39
{% get_setting_value "MAX_FILE_SIZE" as MAX_FILE_SIZE %}
40
40
{% get_setting_value "MAX_FILE_SIZE_STR" as MAX_FILE_SIZE_STR %}
41
+ {% get_setting_value "MAX_ZIP_SIZE" as MAX_ZIP_SIZE %}
42
+ {% get_setting_value "MAX_ZIP_SIZE_STR" as MAX_ZIP_SIZE_STR %}
41
43
< script >
42
44
const requestPath = '{{ request.path }}'
43
45
const maxFileSize = { { MAX_FILE_SIZE } } ;
44
46
const maxFileSizeStr = '{{ MAX_FILE_SIZE_STR }}' ;
47
+ const maxZipSize = { { MAX_ZIP_SIZE } } ;
48
+ const maxZipSizeStr = '{{ MAX_ZIP_SIZE_STR }}' ;
45
49
</ script >
46
50
47
51
< script >
76
80
document . getElementById ( 'file' ) . addEventListener ( "change" , function ( ) {
77
81
if ( this . files && this . files [ 0 ] ) {
78
82
let theFile = this . files [ 0 ] ;
79
-
80
- if ( theFile . size > maxFileSize ) {
83
+
84
+ if ( getFileExt ( theFile . name ) == 'zip' && theFile . size > maxZipSize ) {
85
+ bootstrap5Alert ( { 'message' : gettext ( "Zip file can be up to " ) + maxZipSizeStr , 'title' : gettext ( "ERROR" ) } )
86
+ document . getElementById ( 'file' ) . value = ''
87
+ return
88
+ }
89
+ else if ( theFile . size > maxFileSize && getFileExt ( theFile . name ) != 'zip' ) {
81
90
bootstrap5Alert ( { 'message' : gettext ( "File can be up to " ) + maxFileSizeStr , 'title' : gettext ( "ERROR" ) } )
82
91
document . getElementById ( 'file' ) . value = ''
83
92
return
Original file line number Diff line number Diff line change 198
198
199
199
MAX_FILE_SIZE = 2 * 1024 * 1024 # 2MB
200
200
MAX_FILE_SIZE_STR = "2MB"
201
+ MAX_ZIP_SIZE = 8 * 1024 * 1024 # 8MB
202
+ MAX_ZIP_SIZE_STR = "8MB"
201
203
202
204
CHECK_LDAP_USERS = True
Original file line number Diff line number Diff line change 1
1
set WERKZEUG_DEBUG_PIN = off
2
- python manage.py runserver_plus
2
+ python manage.py runserver_plus --keep-meta-shutdown
You can’t perform that action at this time.
0 commit comments