idlesign / django-sitetree

Reusable application for Django introducing site tree, menu and breadcrumbs navigation elements.
http://github.com/idlesign/django-sitetree
BSD 3-Clause "New" or "Revised" License
348 stars 130 forks source link

Sitetreedump with "tree" arguments don't work correctly #295

Closed witwar closed 3 years ago

witwar commented 3 years ago

The sitetreedump function with the "tree" parameter did not work correctly. Instead of a tuple of aliases, a tuple of characters appeared in the handle function.

The patch below solved the problem for me.

diff -ruN old/sitetree/management/commands/sitetreedump.py new/sitetree/management/commands/sitetreedump.py
--- old/sitetree/management/commands/sitetreedump.py    2021-02-10 21:32:41.402595058 +0300
+++ new/sitetree/management/commands/sitetreedump.py    2021-02-10 21:40:30.149410253 +0300
@@ -30,7 +30,7 @@
     args = '[tree_alias tree_alias ...]'

     def add_arguments(self, parser):
-        parser.add_argument('args', metavar='tree', nargs='?', help='Tree aliases.', default=[])
+        parser.add_argument('args', metavar='tree', nargs='*', help='Tree aliases.', default=[])
         get_options(parser.add_argument)

     def handle(self, *aliases, **options):
idlesign commented 3 years ago

Thank you. Your patch in now in master.