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

ValueError at /admin/categories/category/add/ #98

Open
fission6 opened this issue Jul 10, 2015 · 4 comments
Open

ValueError at /admin/categories/category/add/ #98

fission6 opened this issue Jul 10, 2015 · 4 comments

Comments

@fission6
Copy link

When using the Admin to create a new category the following traceback occurs

screen shot 2015-07-10 at 5 01 23 pm

this is the line that is causing issues

decendant_ids = self.instance.get_descendants().values_list('id', flat=True)

versions
django==1.8.3
django-mptt==0.7.4
django-categories==1.3 # installed directly from the git repo

Note that using the ORM works:
Category(name='whatever').save() works

@esomething
Copy link

I'm having this same issue as well. I think it has to do with changes to the django-mptt module (https://github.com/django-mptt/django-mptt). Seems like the error message is part of code that is new to the 0.7.x branch. Unfortunately, if you try to go back to 0.6.x it breaks Django 1.8!

My Python / Django skills are not good enough to fix this. Any help will be apprecited.

@Nekmo
Copy link

Nekmo commented Jul 22, 2015

I'm testing, but this has worked for me.

Line 111 in base.py
-------------------------
decendant_ids = self.instance.get_descendants().values_list('id', flat=True)

to:

if self.instance.pk:
    decendant_ids = self.instance.get_descendants().values_list('id', flat=True)
else:
    decendant_ids = []

#99

@bashu
Copy link

bashu commented Aug 15, 2015

+1

@johanndt
Copy link

johanndt commented Oct 7, 2015

yet another +1

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

5 participants