Skip to content

Exclusive keyword causing problems because of missing path #46

@EHJ-52n

Description

@EHJ-52n

The keyword to mark subsite exclusive resources implemented in #44 seems to cause problems in my current setup.

The keyword created in

HierarchicalKeyword.objects.get_or_create(name="subsite_exclusive", slug="subsite_exclusive", depth=1)
has an empty path resulting in the following error, if new keywords are added:

Traceback (most recent call last):
  File "/usr/src/geonode/geonode/base/models.py", line 407, in add
    new_tag_obj = HierarchicalKeyword.add_root(name=new_tag)
  File "/usr/local/lib/python3.10/dist-packages/treebeard/mp_tree.py", line 623, in add_root
    return MP_AddRootHandler(cls, **kwargs).process()
  File "/usr/local/lib/python3.10/dist-packages/treebeard/mp_tree.py", line 319, in process
    return last_root.add_sibling('sorted-sibling', **self.kwargs)
  File "/usr/local/lib/python3.10/dist-packages/treebeard/mp_tree.py", line 1106, in add_sibling
    return MP_AddSiblingHandler(self, pos, **kwargs).process()
  File "/usr/local/lib/python3.10/dist-packages/treebeard/mp_tree.py", line 425, in process
    newpos = siblings.all()[0]._get_lastpos_in_path()
  File "/usr/local/lib/python3.10/dist-packages/treebeard/mp_tree.py", line 1204, in _get_lastpos_in_path
    return self._str2int(self.path[-self.steplen:])
  File "/usr/local/lib/python3.10/dist-packages/treebeard/mp_tree.py", line 602, in _str2int
    return cls.numconv_obj().str2int(num)
  File "/usr/local/lib/python3.10/dist-packages/treebeard/numconv.py", line 97, in str2int
    return int(num, radix)
ValueError: invalid literal for int() with base 36: ''
ERROR Error during the keyword creation for keyword: soil_temperature

The workaround is to delete the keyword "subsite_exclusive" and create it again manually, which results in the path 0001. This allows the addition of new keywords.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions