Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#14002 closed (fixed)

filesizeformat filter only supports up to GB

Reported by: Aaron T. Myers Owned by: Aaron T. Myers
Component: Template system Version:
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: yes
Easy pickings: UI/UX:

Description

The product that I work on routinely displays file sizes which are larger than 1 TB, some times larger than 1 PB. The filesizeformat template filter defaults to GB for anything larger than MB. I'd like filesizeformat to support larger sizes.

Attachments (2)

bigger-filesizeformat.diff (1.2 KB) - added by Aaron T. Myers 6 years ago.
bigger-filesizeformat.2.diff (1.7 KB) - added by Aaron T. Myers 6 years ago.
New version with tests and addressing review comment.

Download all attachments as: .zip

Change History (12)

Changed 6 years ago by Aaron T. Myers

Attachment: bigger-filesizeformat.diff added

comment:1 Changed 6 years ago by Alex Gaynor

2 issues. a) Needs tests, b) for the ugettext call the % operator should be *outside* the call to ugettext, not inside.

comment:2 Changed 6 years ago by Alex Gaynor

Needs tests: set
Patch needs improvement: set
Triage Stage: UnreviewedAccepted

comment:3 Changed 6 years ago by Aaron T. Myers

Thanks for the review. New patch forthcoming.

Changed 6 years ago by Aaron T. Myers

New version with tests and addressing review comment.

comment:4 Changed 6 years ago by Russell Keith-Magee

milestone: 1.3
Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:5 Changed 6 years ago by Russell Keith-Magee

Resolution: fixed
Status: newclosed

(In [13585]) Fixed #14002 -- Updated filesize filter to support terabyte and petabyte file sizes. Thanks to Aaron T. Myers for the patch.

comment:6 Changed 6 years ago by Russell Keith-Magee

Strictly, the fix is actually in [13584]... but trac seems to be having some trouble with that revision.

comment:7 Changed 6 years ago by Claude Paroz

There is a problem with the fix, in that units are no more translated. There are missing ugettext calls in BYTE_UNITS tuple. Reopen or open new report?

comment:8 Changed 6 years ago by Russell Keith-Magee

Patch needs improvement: set
Resolution: fixed
Status: closedreopened

No need for a new ticket; I'll update the code.

comment:9 Changed 6 years ago by Russell Keith-Magee

Resolution: fixed
Status: reopenedclosed

(In [13594]) Fixed #14002 -- Modified filesize filter to ensure strings are translatable. Thanks to claudep for the report.

comment:10 Changed 5 years ago by Jacob

milestone: 1.3

Milestone 1.3 deleted

Note: See TracTickets for help on using tickets.
Back to Top