Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion rest_invitations/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,24 @@
from rest_framework import routers

from .app_settings import ACCEPT_INVITE_URL, API_BASE_URL
from .views import InvitationViewSet, accept_invitation
from .views import (InvitationViewSet, accept_invitation)
from .utils import import_callable
from django.conf import settings

InvitationViewSet = import_callable(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add some doc info about these changes?

getattr(
settings,
'INVITATION_VIEW',
InvitationViewSet
)
)
accept_invitation = import_callable(
getattr(
settings,
'INVITATION_ACCEPT_INVATION',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems a typo

accept_invitation
)
)

router = routers.SimpleRouter()
router.register(r'{0}'.format(API_BASE_URL), InvitationViewSet)
Expand Down
1 change: 0 additions & 1 deletion rest_invitations/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ def import_callable(path):
return path
else:
module, attr_name = path.rsplit('.', 1)
print(module, attr_name)
return getattr(import_module(module), attr_name)