diff options
| author | Jon Dufresne <jon.dufresne@gmail.com> | 2016-09-10 16:38:05 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-09-10 16:38:05 -0700 |
| commit | 1ec1633cb294d8ce2a65ece6b56c258483596fba (patch) | |
| tree | 49e7163dad4220da3d99be0a5d981a1a735570a3 /django/contrib/auth/apps.py | |
| parent | 0368d63a78b07e794138a65216b91eadbb47fc2f (diff) | |
Fixed #26401 -- Added BaseAuthConfig to use auth without migrations.
Diffstat (limited to 'django/contrib/auth/apps.py')
| -rw-r--r-- | django/contrib/auth/apps.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/django/contrib/auth/apps.py b/django/contrib/auth/apps.py index d5590158cf..9d128db39c 100644 --- a/django/contrib/auth/apps.py +++ b/django/contrib/auth/apps.py @@ -7,14 +7,26 @@ from .checks import check_models_permissions, check_user_model from .management import create_permissions -class AuthConfig(AppConfig): +class BaseAuthConfig(AppConfig): + """ + AppConfig which assumes that the auth models don't exist. + """ name = 'django.contrib.auth' verbose_name = _("Authentication and Authorization") def ready(self): + checks.register(check_user_model, checks.Tags.models) + + +class AuthConfig(BaseAuthConfig): + """ + The default AppConfig for auth. + """ + + def ready(self): + super(AuthConfig, self).ready() post_migrate.connect( create_permissions, dispatch_uid="django.contrib.auth.management.create_permissions" ) - checks.register(check_user_model, checks.Tags.models) checks.register(check_models_permissions, checks.Tags.models) |
