Fixed a ZeroDivionError by adjusting what is returned by aliashandler.all() when no aliases are given ([] instead of ['']). Also made sure src.utils.stringsuggestions() don't crash in such a situation.

This commit is contained in:
Griatch 2013-10-18 16:15:51 +02:00
parent a1646ec596
commit 55423f6a2f
4 changed files with 9 additions and 7 deletions

View file

@ -592,7 +592,7 @@ class TagHandler(object):
def all(self):
"Get all tags in this handler"
return [to_str(p[0]) for p in _GA(self.obj, self._m2m_fieldname).all().values_list("db_key")]
return [to_str(p[0]) for p in _GA(self.obj, self._m2m_fieldname).all().values_list("db_key") if p[0]]
def __str__(self):
return ",".join(self.all())