Switch to full app paths
Instead of inserting the path of the apps into the Python app, the apps are now referenced by their full import path. This solves name clashes with external or native Python libraries. Example: Mayan statistics app vs. Python new statistics library. Every app reference is now prepended with 'mayan.apps'. Existing config.yml files need to be updated manually. Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
default_app_config = 'authentication.apps.AuthenticationApp'
|
||||
default_app_config = 'mayan.apps.authentication.apps.AuthenticationApp'
|
||||
|
||||
@@ -4,8 +4,8 @@ import logging
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from common import MayanAppConfig, menu_user
|
||||
from navigation.classes import Separator
|
||||
from mayan.apps.common import MayanAppConfig, menu_user
|
||||
from mayan.apps.navigation.classes import Separator
|
||||
|
||||
from .links import link_logout, link_password_change
|
||||
|
||||
@@ -13,8 +13,10 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class AuthenticationApp(MayanAppConfig):
|
||||
app_namespace = 'authentication'
|
||||
app_url = 'authentication'
|
||||
has_tests = True
|
||||
name = 'authentication'
|
||||
name = 'mayan.apps.authentication'
|
||||
verbose_name = _('Authentication')
|
||||
|
||||
def ready(self):
|
||||
|
||||
@@ -7,7 +7,7 @@ from django.contrib.auth import authenticate
|
||||
from django.contrib.auth.forms import AuthenticationForm
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from common.widgets import EmailInput
|
||||
from mayan.apps.common.widgets import EmailInput
|
||||
|
||||
|
||||
class EmailAuthenticationForm(forms.Form):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from appearance.classes import Icon
|
||||
from mayan.apps.appearance.classes import Icon
|
||||
|
||||
icon_logout = Icon(driver_name='fontawesome', symbol='sign-out-alt')
|
||||
icon_password_change = Icon(driver_name='fontawesome', symbol='key')
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import unicode_literals
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation import Link
|
||||
from mayan.apps.navigation import Link
|
||||
|
||||
from .icons import icon_logout, icon_password_change
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import unicode_literals
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from smart_settings import Namespace
|
||||
from mayan.apps.smart_settings import Namespace
|
||||
|
||||
from .literals import DEFAULT_LOGIN_METHOD, DEFAULT_MAXIMUM_SESSION_LENGTH
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
TEST_EMAIL_AUTHENTICATION_BACKEND = 'authentication.auth.email_auth_backend.EmailAuthBackend'
|
||||
TEST_EMAIL_AUTHENTICATION_BACKEND = 'mayan.apps.authentication.auth.email_auth_backend.EmailAuthBackend'
|
||||
|
||||
@@ -5,9 +5,9 @@ from django.core import mail
|
||||
from django.test import override_settings
|
||||
from django.urls import reverse
|
||||
|
||||
from common.tests import GenericViewTestCase
|
||||
from smart_settings.classes import Namespace
|
||||
from user_management.tests.literals import (
|
||||
from mayan.apps.common.tests import GenericViewTestCase
|
||||
from mayan.apps.smart_settings.classes import Namespace
|
||||
from mayan.apps.user_management.tests.literals import (
|
||||
TEST_ADMIN_EMAIL, TEST_ADMIN_PASSWORD, TEST_USER_PASSWORD_EDITED,
|
||||
TEST_ADMIN_USERNAME
|
||||
)
|
||||
|
||||
@@ -15,8 +15,8 @@ from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from stronghold.decorators import public
|
||||
|
||||
from common.settings import setting_project_title, setting_project_url
|
||||
import mayan
|
||||
from mayan.apps.common.settings import setting_project_title, setting_project_url
|
||||
|
||||
from .forms import EmailAuthenticationForm, UsernameAuthenticationForm
|
||||
from .settings import setting_login_method, setting_maximum_session_length
|
||||
|
||||
Reference in New Issue
Block a user