django-admin-views icon indicating copy to clipboard operation
django-admin-views copied to clipboard

admin_views_install_templates command: TypeError: 'set' object does not support indexing

Open sliwowitz opened this issue 10 years ago • 0 comments

When running manage.py admin_views_install_templates, template_dirs is a set which cannot be indexed by [].

$ ./manage.py admin_views_install_templates Traceback (most recent call last): File "./manage.py", line 10, in execute_from_command_line(sys.argv) File "..../python2.7/site-packages/django/core/management/init.py", line 399, in execute_from_command_line utility.execute() File "..../python2.7/site-packages/django/core/management/init.py", line 392, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "..../python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv self.execute(_args, *_options.dict) File "..../python2.7/site-packages/django/core/management/base.py", line 285, in execute output = self.handle(_args, *_options) File "..../python2.7/site-packages/admin_views/management/commands/admin_views_install_templates.py", line 23, in handle dest_dir = os.path.join(template_dirs[0], 'admin/') TypeError: 'set' object does not support indexing

Since this line is invoked in case when there is only one template directory, you can safely call:

dest_dir = os.path.join(template_dirs.pop(), 'admin/')

instead.

sliwowitz avatar Jul 16 '14 01:07 sliwowitz