#1009 closed defect (fixed)
Small bug in HasAllowableSize Validator
Reported by: | Owned by: | Anybody | |
---|---|---|---|
Component: | Validators | Version: | 0.90 |
Severity: | minor | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
When I meant small, I meant really really tiny. The last line in the init definition references min_size when it should reference max_size
class HasAllowableSize: """ Checks that the file-upload field data is a certain size. min_size and max_size are measurements in bytes. """ def __init__(self, min_size=None, max_size=None, min_error_message=None, max_error_message=None): self.min_size, self.max_size = min_size, max_size self.min_error_message = min_error_message or lazy_inter(gettext_lazy("Make sure your uploaded file is at least %s bytes big."), min_size) self.max_error_message = max_error_message or lazy_inter(gettext_lazy("Make sure your uploaded file is at most %s bytes big."), min_size)
That should actually be
self.max_error_message = max_error_message or lazy_inter(gettext_lazy("Make sure your uploaded file is at most %s bytes big."), max_size)
Technically it should be self.max_size, but it doesn't make a difference.
Change History (3)
comment:1 by , 19 years ago
milestone: | → Version 0.91 |
---|---|
Version: | → 0.9 |
comment:2 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
(In [1564]) Fixed #1009 -- Fixed small typo in HasAllowableSize validator. Thanks, bsoltani