Loading django/contrib/auth/apps.py +5 −1 Original line number Diff line number Diff line from django.apps import AppConfig from django.core import checks from django.contrib.auth.checks import check_user_model from django.db.models.signals import post_migrate from django.utils.translation import ugettext_lazy as _ from .management import create_permissions class AuthConfig(AppConfig): name = 'django.contrib.auth' verbose_name = _("Authentication and Authorization") def ready(self): post_migrate.connect(create_permissions, dispatch_uid="django.contrib.auth.management.create_permissions") checks.register(check_user_model, checks.Tags.models) django/contrib/auth/management/__init__.py +4 −6 Original line number Diff line number Diff line Loading @@ -7,11 +7,10 @@ import getpass import unicodedata from django.apps import apps from django.contrib.auth import models as auth_app, get_permission_codename from django.contrib.auth import get_permission_codename from django.core import exceptions from django.core.management.base import CommandError from django.db import DEFAULT_DB_ALIAS, router from django.db.models import signals from django.utils.encoding import DEFAULT_LOCALE_ENCODING from django.utils import six Loading Loading @@ -149,6 +148,9 @@ def get_default_username(check_db=True): :returns: The username, or an empty string if no username can be determined. """ # This file is used in apps.py, it should not trigger models import. from django.contrib.auth import models as auth_app # If the User model has been swapped out, we can't make any assumptions # about the default user name. if auth_app.User._meta.swapped: Loading Loading @@ -177,7 +179,3 @@ def get_default_username(check_db=True): else: return '' return default_username signals.post_migrate.connect(create_permissions, dispatch_uid="django.contrib.auth.management.create_permissions") django/contrib/contenttypes/apps.py +4 −0 Original line number Diff line number Diff line from django.apps import AppConfig from django.contrib.contenttypes.checks import check_generic_foreign_keys from django.core import checks from django.db.models.signals import post_migrate from django.utils.translation import ugettext_lazy as _ from .management import update_contenttypes class ContentTypesConfig(AppConfig): name = 'django.contrib.contenttypes' verbose_name = _("Content Types") def ready(self): post_migrate.connect(update_contenttypes) checks.register(check_generic_foreign_keys, checks.Tags.models) django/contrib/contenttypes/management.py +0 −4 Original line number Diff line number Diff line from django.apps import apps from django.db import DEFAULT_DB_ALIAS, router from django.db.models import signals from django.utils.encoding import smart_text from django.utils import six from django.utils.six.moves import input Loading Loading @@ -92,8 +91,5 @@ def update_all_contenttypes(**kwargs): update_contenttypes(app_config, **kwargs) signals.post_migrate.connect(update_contenttypes) if __name__ == "__main__": update_all_contenttypes() django/contrib/sites/apps.py +6 −0 Original line number Diff line number Diff line from django.apps import AppConfig from django.db.models.signals import post_migrate from django.utils.translation import ugettext_lazy as _ from .management import create_default_site class SitesConfig(AppConfig): name = 'django.contrib.sites' verbose_name = _("Sites") def ready(self): post_migrate.connect(create_default_site, sender=self) Loading
django/contrib/auth/apps.py +5 −1 Original line number Diff line number Diff line from django.apps import AppConfig from django.core import checks from django.contrib.auth.checks import check_user_model from django.db.models.signals import post_migrate from django.utils.translation import ugettext_lazy as _ from .management import create_permissions class AuthConfig(AppConfig): name = 'django.contrib.auth' verbose_name = _("Authentication and Authorization") def ready(self): post_migrate.connect(create_permissions, dispatch_uid="django.contrib.auth.management.create_permissions") checks.register(check_user_model, checks.Tags.models)
django/contrib/auth/management/__init__.py +4 −6 Original line number Diff line number Diff line Loading @@ -7,11 +7,10 @@ import getpass import unicodedata from django.apps import apps from django.contrib.auth import models as auth_app, get_permission_codename from django.contrib.auth import get_permission_codename from django.core import exceptions from django.core.management.base import CommandError from django.db import DEFAULT_DB_ALIAS, router from django.db.models import signals from django.utils.encoding import DEFAULT_LOCALE_ENCODING from django.utils import six Loading Loading @@ -149,6 +148,9 @@ def get_default_username(check_db=True): :returns: The username, or an empty string if no username can be determined. """ # This file is used in apps.py, it should not trigger models import. from django.contrib.auth import models as auth_app # If the User model has been swapped out, we can't make any assumptions # about the default user name. if auth_app.User._meta.swapped: Loading Loading @@ -177,7 +179,3 @@ def get_default_username(check_db=True): else: return '' return default_username signals.post_migrate.connect(create_permissions, dispatch_uid="django.contrib.auth.management.create_permissions")
django/contrib/contenttypes/apps.py +4 −0 Original line number Diff line number Diff line from django.apps import AppConfig from django.contrib.contenttypes.checks import check_generic_foreign_keys from django.core import checks from django.db.models.signals import post_migrate from django.utils.translation import ugettext_lazy as _ from .management import update_contenttypes class ContentTypesConfig(AppConfig): name = 'django.contrib.contenttypes' verbose_name = _("Content Types") def ready(self): post_migrate.connect(update_contenttypes) checks.register(check_generic_foreign_keys, checks.Tags.models)
django/contrib/contenttypes/management.py +0 −4 Original line number Diff line number Diff line from django.apps import apps from django.db import DEFAULT_DB_ALIAS, router from django.db.models import signals from django.utils.encoding import smart_text from django.utils import six from django.utils.six.moves import input Loading Loading @@ -92,8 +91,5 @@ def update_all_contenttypes(**kwargs): update_contenttypes(app_config, **kwargs) signals.post_migrate.connect(update_contenttypes) if __name__ == "__main__": update_all_contenttypes()
django/contrib/sites/apps.py +6 −0 Original line number Diff line number Diff line from django.apps import AppConfig from django.db.models.signals import post_migrate from django.utils.translation import ugettext_lazy as _ from .management import create_default_site class SitesConfig(AppConfig): name = 'django.contrib.sites' verbose_name = _("Sites") def ready(self): post_migrate.connect(create_default_site, sender=self)