diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-03-06 10:45:39 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-03-06 11:18:41 +0100 |
commit | 6a3126fbde683b032d508145082b188cab6d8816 (patch) | |
tree | 83b6c71d0cecb60949d875d3cffc6ba7014c14cb /ishtar_common/utils.py | |
parent | 86bedd965dccb04698cf88474c7de6a7406a6322 (diff) | |
download | Ishtar-6a3126fbde683b032d508145082b188cab6d8816.tar.bz2 Ishtar-6a3126fbde683b032d508145082b188cab6d8816.zip |
Utils shortify: manage None value
Diffstat (limited to 'ishtar_common/utils.py')
-rw-r--r-- | ishtar_common/utils.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ishtar_common/utils.py b/ishtar_common/utils.py index f1236a5ac..f1e2e4b96 100644 --- a/ishtar_common/utils.py +++ b/ishtar_common/utils.py @@ -101,6 +101,8 @@ SHORTIFY_STR = ugettext(" (...)") def shortify(lbl, number=20): + if not lbl: + lbl = '' if len(lbl) <= number: return lbl return lbl[:number - len(SHORTIFY_STR)] + SHORTIFY_STR |