django-tagulous
django-tagulous copied to clipboard
Can not add single character parent tag.
Django 1.11.3 django-tagulous 0.13.2
class Media(models.Model):
tags = tagulous.models.TagField(
space_delimiter=False,
tree=True,
related_name='medias',
blank=True
)
>>> Media.tags.tag_model.objects.create(name='r')
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "D:\virtual_env\lib\site-packages\django\db\models\manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "D:\virtual_env\lib\site-packages\django\db\models\query.py", line 394, in create
obj.save(force_insert=True, using=self.db)
File "D:\virtual_env\lib\site-packages\tagulous\models\models.py", line 711, in save
self.label = parts[-1]
IndexError: list index out of range
Looks like utils.split_tree_name
returns an empty list.
This is probably related to #81 .