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

AttributeError: module 'authority' has no attribute 'register' #70

Open
daveseff opened this issue Mar 3, 2020 · 0 comments
Open

AttributeError: module 'authority' has no attribute 'register' #70

daveseff opened this issue Mar 3, 2020 · 0 comments

Comments

@daveseff
Copy link

daveseff commented Mar 3, 2020

Following the documentation, It seems that register is not an attribute of authority:

import authority
from authority import permissions
from django.contrib.flatpages.models import FlatPage

class FlatpagePermission(permissions.BasePermission):
    label = 'flatpage_permission'

authority.register(FlatPage, FlatpagePermission)

This gave me the error:
AttributeError: module 'authority' has no attribute 'register'

I then discovered that there is this, which seems to not throw the error but I'm not sure if this will do the same thing:
authority.utils.register(FlatPage, FlatPagePermission)

Is this correct, or did I not do something correctly?

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