Code

Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#14002 closed (fixed)

filesizeformat filter only supports up to GB

Reported by: atm Owned by: atm
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 atm 4 years ago.
bigger-filesizeformat.2.diff (1.7 KB) - added by atm 4 years ago.
New version with tests and addressing review comment.

Download all attachments as: .zip

Change History (12)

Changed 4 years ago by atm

comment:1 Changed 4 years ago by Alex

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

comment:2 Changed 4 years ago by Alex

  • Needs tests set
  • Patch needs improvement set
  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 4 years ago by atm

Thanks for the review. New patch forthcoming.

Changed 4 years ago by atm

New version with tests and addressing review comment.

comment:4 Changed 4 years ago by russellm

  • milestone set to 1.3
  • Patch needs improvement unset
  • Triage Stage changed from Accepted to Ready for checkin

comment:5 Changed 4 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

(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 4 years ago by russellm

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

comment:7 Changed 4 years ago by claudep

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 4 years ago by russellm

  • Patch needs improvement set
  • Resolution fixed deleted
  • Status changed from closed to reopened

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

comment:9 Changed 4 years ago by russellm

  • Resolution set to fixed
  • Status changed from reopened to closed

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

comment:10 Changed 3 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.