Commit 568479ae authored by Ivan Tyagov's avatar Ivan Tyagov

Take into account generate_nice_id argument (contributed by JP).

parent 562dfdb2
......@@ -95,8 +95,18 @@ def createWebSectionFromCategoryValue(container, category, depth, section_id=Non
else:\n
section_id = getNiceID(category.getTitle()) or getNiceID(category.getId())\n
except ValueError:\n
# It is not an int, so it can be used as is\n
section_id = category.getId()\n
if not generate_nice_id:\n
# It is not an int, so it can be used as is\n
section_id = category.getId()\n
else:\n
if category.hasReference():\n
section_id = getNiceID(category.getReference())\\\n
or getNiceID(category.getTitle()) or getNiceID(category.getId())\n
if category.hasShortTitle():\n
section_id = getNiceID(category.getShortTitle())\\\n
or getNiceID(category.getTitle()) or getNiceID(category.getId())\n
else:\n
section_id = getNiceID(category.getTitle()) or getNiceID(category.getId())\n
# Create a new Web Section if necessary\n
new_section = None\n
if section_id not in container.contentIds():\n
......
1089
\ No newline at end of file
1090
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment