@@ -143,7 +143,7 @@ def __call__(self, model: BaseModel):
143143 def match_multi_valued_attribute_sub (
144144 self , attribute : str , condition : str , model : BaseModel , sub_attribute : str
145145 ):
146- attribute_name = get_by_alias (model , attribute )
146+ attribute_name = get_by_alias (type ( model ) , attribute )
147147 multi_valued_attribute = get_or_create (model , attribute_name , True )
148148 if not isinstance (multi_valued_attribute , list ):
149149 raise SCIMException (Error .make_invalid_path_error ())
@@ -159,7 +159,7 @@ def match_multi_valued_attribute(
159159 ):
160160 if self .REQUIRES_VALUE and not isinstance (self .value , dict ):
161161 raise SCIMException (Error .make_invalid_value_error ())
162- attribute_name = get_by_alias (model , attribute )
162+ attribute_name = get_by_alias (type ( model ) , attribute )
163163 multi_valued_attribute = get_or_create (
164164 model , attribute_name , self .REQUIRES_VALUE
165165 )
@@ -187,7 +187,7 @@ def match_multi_valued_attribute(
187187
188188 def match_complex_attribute (self , attribute : str , model : BaseModel , sub_path : str ):
189189 complex_attribute = get_or_create (
190- model , get_by_alias (model , attribute ), self .REQUIRES_VALUE
190+ model , get_by_alias (type ( model ) , attribute ), self .REQUIRES_VALUE
191191 )
192192 if isinstance (complex_attribute , list ) and complex_attribute :
193193 for value in complex_attribute :
@@ -219,7 +219,7 @@ class AddOperator(Operator):
219219
220220 @classmethod
221221 def operation (cls , model : BaseModel , attribute : str , value : Any ):
222- alias = get_by_alias (model , attribute )
222+ alias = get_by_alias (type ( model ) , attribute )
223223 if model .get_field_multiplicity (alias ) and isinstance (value , list ):
224224 for v in value :
225225 cls .operation (model , attribute , v )
@@ -257,7 +257,7 @@ class RemoveOperator(Operator):
257257
258258 @classmethod
259259 def operation (cls , model : BaseModel , attribute : str , value : Any ):
260- alias = get_by_alias (model , attribute )
260+ alias = get_by_alias (type ( model ) , attribute )
261261 existing_value = getattr (model , alias )
262262 if not existing_value :
263263 return
@@ -279,7 +279,7 @@ class ReplaceOperator(Operator):
279279
280280 @classmethod
281281 def operation (cls , model : BaseModel , attribute : str , value : Any ):
282- alias = get_by_alias (model , attribute )
282+ alias = get_by_alias (type ( model ) , attribute )
283283 if model .get_field_multiplicity (alias ) and not isinstance (value , list ):
284284 raise SCIMException (Error .make_invalid_value_error ())
285285
@@ -362,7 +362,7 @@ def init_return(
362362 sub_attribute : str | None ,
363363 value : ResolveResult ,
364364 ):
365- alias = get_by_alias (model , attribute )
365+ alias = get_by_alias (type ( model ) , attribute )
366366 value .model = model
367367 value .attribute = alias
368368 value .sub_attribute = sub_attribute
@@ -376,7 +376,7 @@ def init_return(
376376 def operation (
377377 cls , model : BaseModel , attribute : str , value : Any , index : int | None = None
378378 ):
379- alias = get_by_alias (model , attribute )
379+ alias = get_by_alias (type ( model ) , attribute )
380380 if index is None :
381381 value .add_result (model , alias )
382382 else :
@@ -414,7 +414,7 @@ def set_value_case_exact(self, value: Any, case_exact: CaseExact):
414414 self .value = value
415415
416416 def evaluate_value_for_complex (self , model : BaseModel , alias : str ):
417- sub_attribute_alias = get_by_alias (model , alias , True )
417+ sub_attribute_alias = get_by_alias (type ( model ) , alias , True )
418418 if self .alias_forbidden (model , sub_attribute_alias ):
419419 return
420420 case_exact = model .get_field_annotation (sub_attribute_alias , CaseExact )
@@ -429,7 +429,7 @@ def __call__(self, model: BaseModel):
429429 return
430430 sub_attribute = path ["sub_attribute" ] or "value"
431431
432- attribute_alias = get_by_alias (model , path ["attribute" ], True )
432+ attribute_alias = get_by_alias (type ( model ) , path ["attribute" ], True )
433433 if self .alias_forbidden (model , attribute_alias ):
434434 return
435435
0 commit comments