Skip to content

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

@daveseff

Description

@daveseff

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions