You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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"
)
last_login_field = getattr(get_user_model(), 'last_login', None)
# Register the handler only if UserModel.last_login is a field.
if isinstance(last_login_field, DeferredAttribute):
from .models import update_last_login
user_logged_in.connect(update_last_login, dispatch_uid='update_last_login')
checks.register(check_user_model, checks.Tags.models)
checks.register(check_models_permissions, checks.Tags.models)
if isinstance(last_login_field, DeferredAttribute): is negative
because type(last_login_field) = <class 'model_utils.tracker.DescriptorWrapper'>
Environment
Django Model Utils version: 4.1.1
Django version: 2.2.24
Python version: 3.7.12
The text was updated successfully, but these errors were encountered:
Problem
if isinstance(last_login_field, DeferredAttribute):
is negativebecause type(last_login_field) =
<class 'model_utils.tracker.DescriptorWrapper'>
Environment
The text was updated successfully, but these errors were encountered: