#24 — File name is split at first '.' when generating title
by
Manuel Reinhardt
—
last modified
Jul 10, 2012 08:17 PM
| State | Resolved |
|---|---|
| Version: | 1.4 |
| Area | Functionality |
| Issue type | Bug |
| Severity | Medium |
| Submitted by | Manuel Reinhardt |
| Submitted on | Jun 15, 2012 |
| Responsible | Thomas Desvenain |
| Target release: |
—
|
If no title is passed to QuickUploadCapableFileFactory, a title is generated from the filename (browser/uploadcapable.py:64).
title = name.split('.')[0].replace('_',' ').replace('-',' ')
Everything after the first '.' is discarded, so if I upload a file "bla.some_important_text.pdf", the title is only "bla".
I would expect it to be "bla some important text". Changing the above line to
'.'.join(name.split('.')[:-1]).replace('_',' ').replace('-',' ').replace('.', ' ')
will do this.
title = name.split('.')[0].replace('_',' ').replace('-',' ')
Everything after the first '.' is discarded, so if I upload a file "bla.some_important_text.pdf", the title is only "bla".
I would expect it to be "bla some important text". Changing the above line to
'.'.join(name.split('.')[:-1]).replace('_',' ').replace('-',' ').replace('.', ' ')
will do this.
- Steps to reproduce:
- Upload a file with multiple '.'s in the filename
Added by
Manuel Reinhardt
on
Jun 15, 2012 02:21 PM
Sorry, the full replacement line would of course betitle = '.'.join(name.split('.')[:-1]).replace('_',' ').replace('-',' ').replace('.', ' ')
Added by
Thomas Desvenain
on
Jul 10, 2012 08:17 PM
fixed in master
Issue state:
Unconfirmed
→
Resolved
Responsible manager:
(UNASSIGNED)
→
thomasdesvenain
No responses can be added.
If you can, please log in before submitting a reaction.
