def METHOD_NAME(sender, credentials, **kwargs):
    now = timezone.now()
    user_name = credentials.get("username", None)
    user_obj = Users.objects.filter(username=user_name)[0:1]
    user_count = user_obj.count()
    user_id = 0
    user_display = ""
    if user_count > 0:
        user_id = user_obj[0].id
        user_display = user_obj[0].display
    AuditEntry.objects.create(
        action="登入失败",
        user_id=user_id,
        user_name=user_name,
        user_display=user_display,
        action_time=now,
    )