I am attempting to assign a user permissions to a task using django-guardian and I'm getting errors.
Inside of my Task class in task/models.py, I have:
class Meta(BaseModel.Meta):
permissions = (
("task_view", "Person can view task details"),
)
When I go into
python manage.py shell
and attempt to assign those permissions, it throws an error.
Here is what I'm attempting:
from profiles.models import SiteUser
from task.models import *
from guardian.shortcuts import assign_perm
siteuser = SiteUser.objects.get(id=2454)
task = Task.objects.get(name="asdf")
assign_perm('task_view', siteuser, task)
And here's the error:
DoesNotExist: Permission matching query does not exist.
Does anyone know what I'm doing wrong? I think I followed the instructions in the django-guardian help, but maybe I missed something?