Skip to content

Commit

Permalink
[users] Fixed integration with openwisp-users
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesifier committed Mar 10, 2017
1 parent 0a4514f commit cbca4e1
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
7 changes: 7 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ Add ``openwisp_controller.loaders.DependencyLoader`` to ``TEMPLATES`` in your ``
}
]
Add the following settings to ``settings.py``:

.. code-block:: python
LOGIN_REDIRECT_URL = 'admin:index'
ACCOUNT_LOGOUT_REDIRECT_URL = LOGIN_REDIRECT_URL
``urls.py``:

.. code-block:: python
Expand Down
8 changes: 8 additions & 0 deletions openwisp_controller/tests/test_users_integration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from openwisp_users.tests.test_admin import TestUsersAdmin


class TestUsersIntegration(TestUsersAdmin):
"""
tests integration with openwisp_users
"""
pass
8 changes: 8 additions & 0 deletions openwisp_controller/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
from django.conf.urls import include, url

url_metadata = [
# allauth proxy
{
'regexp': r'^accounts/',
'app': 'openwisp_users',
'include': {
'module': 'openwisp_users.accounts.urls'
}
},
# django-netjsonconfig schemas
{
'regexp': r'^',
Expand Down
4 changes: 3 additions & 1 deletion tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
'django.contrib.sites',
'allauth',
'allauth.account',
'allauth.socialaccount',
'django_extensions',
# openwisp2 modules
'openwisp_users',
Expand Down Expand Up @@ -65,7 +66,6 @@
USE_I18N = False
USE_L10N = False
STATIC_URL = '/static/'
CORS_ORIGIN_ALLOW_ALL = True

TEMPLATES = [
{
Expand All @@ -88,6 +88,8 @@
]

EMAIL_PORT = '1025' # for testing purposes
LOGIN_REDIRECT_URL = 'admin:index'
ACCOUNT_LOGOUT_REDIRECT_URL = LOGIN_REDIRECT_URL

# local settings must be imported before test runner otherwise they'll be ignored
try:
Expand Down

0 comments on commit cbca4e1

Please sign in to comment.