docs: add docs for passbook_user_debug

This commit is contained in:
Jens Langhammer
2020-09-14 21:53:32 +02:00
parent 40614a65fc
commit b3262e2a82
10 changed files with 29 additions and 10 deletions

View File

@ -122,8 +122,10 @@ class PolicyEngine:
if result.messages:
final_result.messages.extend(result.messages)
if not result.passing:
final_result.messages = tuple(final_result.messages)
final_result.passing = False
return final_result
final_result.messages = tuple(final_result.messages)
final_result.passing = True
return final_result

View File

@ -12,7 +12,6 @@ from structlog import get_logger
from passbook.core.models import Application, Provider, User
from passbook.flows.views import (
SESSION_KEY_APPLICATION_PRE,
SESSION_KEY_DENIED_ERROR,
SESSION_KEY_DENIED_POLICY_RESULT,
)
from passbook.policies.engine import PolicyEngine

View File

@ -9,7 +9,7 @@ from sentry_sdk.tracing import Span
from structlog import get_logger
from passbook.policies.exceptions import PolicyException
from passbook.policies.models import Policy, PolicyBinding
from passbook.policies.models import PolicyBinding
from passbook.policies.types import PolicyRequest, PolicyResult
LOGGER = get_logger()

View File

@ -1,7 +1,6 @@
"""policy structures"""
from __future__ import annotations
from dataclasses import field
from typing import TYPE_CHECKING, Dict, List, Optional, Tuple
from django.db.models import Model