Commit 390a474778df44d4bd317934fd86bb8c56f7d608
1 parent
3d9ff8f2
Another reflex validation bugfix.
Showing
1 changed file
with
10 additions
and
8 deletions
semantics/validation.py
... | ... | @@ -91,17 +91,19 @@ def duplicates_exists(frame, actual_frames): |
91 | 91 | return False |
92 | 92 | |
93 | 93 | def schemas_reflex_agreed(lemma, frame): |
94 | + agreed = True | |
94 | 95 | complements = frame.complements.all() |
95 | 96 | lexical_units = frame.lexical_units.all() |
96 | - for lex_unit in lexical_units: | |
97 | - lex_unit_agree = True | |
98 | - for schema in lemma.frames.all(): | |
99 | - if not schema_lex_unit_reflex_agree(lex_unit, schema, complements): | |
100 | - lex_unit_agree = False | |
97 | + for schema in lemma.frames.all(): | |
98 | + schema_agreed = False | |
99 | + for lex_unit in lexical_units: | |
100 | + if schema_lex_unit_reflex_agree(lex_unit, schema, complements): | |
101 | + schema_agreed = True | |
101 | 102 | break |
102 | - if lex_unit_agree: | |
103 | - return True | |
104 | - return False | |
103 | + if not schema_agreed: | |
104 | + agreed = False | |
105 | + break | |
106 | + return agreed | |
105 | 107 | |
106 | 108 | def schema_lex_unit_reflex_agree(lexical_unit, schema, complements): |
107 | 109 | if complements.filter(realizations__frame=schema).exists(): |
... | ... |