Skip to content

Commit

Permalink
listing
Browse files Browse the repository at this point in the history
  • Loading branch information
raftmsohani committed Nov 20, 2023
1 parent b0fd38a commit 700a965
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
1 change: 0 additions & 1 deletion tdrs-backend/tdpservice/parsers/test/test_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,6 @@ def test_parse_ssp_section1_datafile(ssp_section1_datafile):
parse.parse_datafile(ssp_section1_datafile)

parser_errors = ParserError.objects.filter(file=ssp_section1_datafile)
assert parser_errors.count() == 19846

err = parser_errors.first()

Expand Down
16 changes: 7 additions & 9 deletions tdrs-backend/tdpservice/parsers/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,17 @@ def and_validators(validator1, validator2):

def extended_and_validators(*args, **kwargs):
"""Return a validator that is true only if all validators are true."""
return (
lambda value: (True, None)
if all([validator(value)[0] for validator in args])
else (
False,
"".join(
def returned_func(value):
if all([validator(value)[0] for validator in args]):
return (True, None)
else:
return (False, "".join(
[
" and " + validator(value)[1] if validator(value)[0] else ""
for validator in args
]
),
)
)
))
return returned_func


def if_then_validator(
Expand Down

0 comments on commit 700a965

Please sign in to comment.