mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-18 12:11:11 +00:00
tweak to validator message. passing through max size vars
This commit is contained in:
parent
5999e96505
commit
50f8aed9c3
3 changed files with 3 additions and 1 deletions
|
|
@ -15,6 +15,7 @@ $(function(){
|
|||
sequentialUploads: true,
|
||||
dropZone: $('.drop-zone'),
|
||||
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
|
||||
maxFileSize: window.max_file_size,
|
||||
previewMinWidth:150,
|
||||
previewMaxWidth:150,
|
||||
previewMinHeight:150,
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@
|
|||
|
||||
{% url 'wagtailadmin_tag_autocomplete' as autocomplete_url %}
|
||||
<script>
|
||||
window.max_file_size = {{ max_filesize }};
|
||||
window.simple_upload_url = "{% url 'wagtailimages_add_image' %}";
|
||||
window.tagit_opts = {
|
||||
autocomplete: {source: "{{ autocomplete_url|addslashes }}"}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ def validate_image_format(f):
|
|||
extension = 'jpeg'
|
||||
|
||||
if extension not in ['gif', 'jpeg', 'png']:
|
||||
raise ValidationError(_("Not a valid image. Please use a gif, jpeg or png file with the correct file extension (*.gif, *.jpg or *.png)."))
|
||||
raise ValidationError(_("Not a supported image type. Please use a gif, jpeg or png file with the correct file extension (*.gif, *.jpg or *.png)."))
|
||||
|
||||
if not f.closed:
|
||||
# Open image file
|
||||
|
|
|
|||
Loading…
Reference in a new issue