feat(access): Add init to tenancy model to clear state

ref: #788 #767
This commit is contained in:
2025-06-05 14:29:50 +09:30
parent cc483e2cb5
commit 074aa4832a
2 changed files with 20 additions and 8 deletions

View File

@ -79,6 +79,16 @@ class TenancyAbstractModel(
ValidationError: User failed to supply organization
"""
def __init____init__(self, *args, **kwargs):
self.context: dict = {
'logger': None,
'user': None,
}
super().__init__(*args, **kwargs)
context: dict = {
'logger': None,
'user': None,

View File

@ -5,17 +5,19 @@ from access.models.tenancy_abstract import TenancyAbstractModel
@pytest.fixture( scope = 'class')
def model_tenancyabstract():
def clean_model():
the_model = TenancyAbstractModel
the_model = TenancyAbstractModel
the_model.context = {
'logger': None,
'user': None,
}
the_model.context = {
'logger': None,
'user': None,
}
return the_model
yield the_model
yield clean_model()
the_model.context = {
'logger': None,
'user': None,
}