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

[FIXES #344] Real Cause of 'rest_framework namespace is not Unique' is not Fixed #345

Merged
merged 3 commits into from
Jul 21, 2021
Merged
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
4 changes: 3 additions & 1 deletion geonode_mapstore_client/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#########################################################################
from django.apps import AppConfig as BaseAppConfig
from django.utils.translation import ugettext_lazy as _
from django.apps import apps


def run_setup_hooks(*args, **kwargs):
Expand All @@ -28,5 +29,6 @@ class AppConfig(BaseAppConfig):
label = "geonode_mapstore_client"

def ready(self):
run_setup_hooks()
if not apps.ready:
Copy link
Member

Choose a reason for hiding this comment

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

It looks to me that by adding this check the run_setup_hooks() will never be executed

Copy link
Author

Choose a reason for hiding this comment

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

No Alessio. It still gets executed.

  1. Adds the urls.
  2. Also tested with breakpoints at different places, api/urls.py inclusive.

Copy link
Member

@afabiani afabiani Jul 20, 2021

Choose a reason for hiding this comment

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

Ok, I trust you, haven't tested on my side.

Copy link
Author

Choose a reason for hiding this comment

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

My pleasure. And I had to.

run_setup_hooks()
super(AppConfig, self).ready()
3 changes: 1 addition & 2 deletions mapstore2_adapter/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@
router.register(r'resources', views.MapStoreResourceViewSet, basename="resources")

urlpatterns = [
url(r'^rest/', include(router.urls)),
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
url(r'^rest/', include(router.urls))
]