1

I'm using django-guardian to implement object level permissions. I created custom permissions in the Models and I have migrated & tried resetting migrations and re-migrating, but I still run into a DoesNotExist error:

Permission matching query does not exist.

Can anyone help me fix this?

tutuDajuju
  • 10,307
  • 6
  • 65
  • 88
  • Could you add the code of the model class where you added the custom permissions? Also, did you update the `reports` app with your custom permissions or have they been present from the first time you migrated it? If you updated them, did you call `./manage.py makemigrations reports` before you ran `./manage.py migrate reports` again? – sthzg Apr 26 '15 at 15:24

1 Answers1

0

As django-guardian uses django for creation of permissions, you would have to first create custom permissions as with any Django app.

What version of Django are you using? If it is 1.6 or lower you might have to run syncdb --all to create the permissions. See documentation here.

tutuDajuju
  • 10,307
  • 6
  • 65
  • 88