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

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

Open
sliwowitz opened this issue Jul 16, 2014 · 0 comments

Comments

@sliwowitz
Copy link

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.

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

No branches or pull requests

1 participant