Skip to content

Commit

Permalink
Merge pull request #411 from collective/max_fileupload
Browse files Browse the repository at this point in the history
Max fileupload
  • Loading branch information
thet authored Mar 12, 2024
2 parents 2b154ef + a8ff466 commit a1da7c1
Show file tree
Hide file tree
Showing 21 changed files with 946 additions and 776 deletions.
6 changes: 5 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ Changelog
4.1.7 (unreleased)
------------------

- Nothing changed yet.
- Add filesize upload limit for file and image uploads.
[ThibautBorn]

- Update Dutch translations.
[ThibautBorn]


4.1.6 (2024-03-08)
Expand Down
6 changes: 6 additions & 0 deletions src/collective/easyform/browser/controlpanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ class IEasyFormControlPanel(Interface):
default=u",",
)

max_filesize = schema.Int(
title=_(u"Filesize limit"),
description=_(u"Set the maximum filesize (in bytes) that users should be able to upload."),
required=False
)


class EasyFormControlPanelForm(RegistryEditForm):
schema = IEasyFormControlPanel
Expand Down
1 change: 0 additions & 1 deletion src/collective/easyform/browser/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,5 +215,4 @@ def __call__(self):
)
# and save
self.save(source)
# import pdb; pdb.set_trace()
return self.template()
9 changes: 9 additions & 0 deletions src/collective/easyform/fields.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,13 @@
name="collective.easyform.fields.Likert"
component=".fields.LikertHandler"
/>
<adapter
provides="z3c.form.interfaces.IValidator"
for="collective.easyform.interfaces.IEasyForm
*
*
plone.namedfile.interfaces.INamedField
*"
factory="collective.easyform.validators.FileSizeValidator"
/>
</configure>
Loading

0 comments on commit a1da7c1

Please sign in to comment.