From d8cf5d33ddda3448dec00dfafe6b333536866f76 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Tue, 4 Oct 2022 12:29:56 -0400 Subject: [PATCH] Common: Extract MutableInfectionMonkeyModelConfig --- monkey/common/base_models.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/monkey/common/base_models.py b/monkey/common/base_models.py index c2df68c5f..94e744d3a 100644 --- a/monkey/common/base_models.py +++ b/monkey/common/base_models.py @@ -10,6 +10,11 @@ class InfectionMonkeyModelConfig: extra = Extra.forbid +class MutableInfectionMonkeyModelConfig(InfectionMonkeyModelConfig): + allow_mutation = True + validate_assignment = True + + class InfectionMonkeyBaseModel(BaseModel): class Config(InfectionMonkeyModelConfig): pass @@ -47,6 +52,5 @@ class InfectionMonkeyBaseModel(BaseModel): class MutableInfectionMonkeyBaseModel(InfectionMonkeyBaseModel): - class Config(InfectionMonkeyModelConfig): - allow_mutation = True - validate_assignment = True + class Config(MutableInfectionMonkeyModelConfig): + pass