Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not add single character parent tag. #54

Open
hepasido opened this issue Aug 1, 2018 · 1 comment
Open

Can not add single character parent tag. #54

hepasido opened this issue Aug 1, 2018 · 1 comment

Comments

@hepasido
Copy link

hepasido commented Aug 1, 2018

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.

@mcrot
Copy link
Contributor

mcrot commented Oct 15, 2019

This is probably related to #81 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants