diff --git a/djangoldp/urls.py b/djangoldp/urls.py index 4a9fb6d4c5d7d24c5ea31ff4f0ff9529b2de695b..38bfe5202982bd5f72dd6a367a26f75c41529969 100644 --- a/djangoldp/urls.py +++ b/djangoldp/urls.py @@ -27,9 +27,13 @@ urlpatterns = [ for package in settings.DJANGOLDP_PACKAGES: try: import_module('{}.models'.format(package)) + urlpatterns.append(url(r'^', include('{}.djangoldp_urls'.format(package)))) except ModuleNotFoundError: pass +if 'djangoldp_account' not in settings.DJANGOLDP_PACKAGES: + urlpatterns.append(url(r'^users/', LDPViewSet.urls(model=settings.AUTH_USER_MODEL, permission_classes=[]))) + # fetch a list of all models which subclass DjangoLDP Model model_classes = {cls.__name__: cls for cls in Model.__subclasses__()} @@ -46,12 +50,3 @@ for class_name in model_classes: permission_classes=Model.get_meta(model_class, 'permission_classes', [LDPPermissions]), fields=Model.get_meta(model_class, 'serializer_fields', []), nested_fields=Model.get_meta(model_class, 'nested_fields', []))))) - -for package in settings.DJANGOLDP_PACKAGES: - try: - urlpatterns.append(url(r'^', include('{}.djangoldp_urls'.format(package)))) - except ModuleNotFoundError: - pass - -if 'djangoldp_account' not in settings.DJANGOLDP_PACKAGES: - urlpatterns.append(url(r'^users/', LDPViewSet.urls(model=settings.AUTH_USER_MODEL, permission_classes=[])))