Hi everyone,

I'm trying to enforce a customer permission on Add/Update. In my
model, I have defined the permission:

permissions = (
                       ('can_approve_stories','Can Approve Stories'),
        )



in my model.ModelAdmin I have:

def change_view(self, request, obj_id):
        if request.user.has_perm('can_approve_stories'):
            return super(StoryAdmin, self).change_view(request,
obj_id)
        else:
            raise PermissionDenied

    def add_view(self, request, obj_id):
        if request.user.has_perm('can_approve_stories'):
            return super(StoryAdmin, self).add_view(request, obj_id)
        else:
            raise PermissionDenied


The change_view permission is working. The add_view thrown an error:

TypeError at /admin/stories/story/add/
add_view() takes exactly 3 arguments (2 given)

Can someone please show me what I'm doing wrong?

TIA,
Brandon
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to