Skip to content

Commit

Permalink
changed pattern for data_element (#433)
Browse files Browse the repository at this point in the history
* changed pattern for data_element
  • Loading branch information
DeltaDaniel authored Jul 31, 2024
1 parent e09d9b8 commit 59e8597
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/maus/models/anwendungshandbuch.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,13 +249,15 @@ def _check_that_nearly_all_lines_have_a_segment_group(instance, attribute, value
raise ValueError(f"There is a None segment group in line {last(switches_from_no_sg_to_sg[1])}")


_data_element_pattern = re.compile(r"^\d{4}$")
_data_element_pattern = re.compile(r"^\d{4}$|^\d{5}$|^[A-Za-z]+\d{4}$")


# pylint:disable=unused-argument
def _check_that_line_has_either_none_or_d4_data_element(instance, attribute, value: AhbLine):
"""
checks that the given line has either a None data element or a data element that matches \\d{4}
checks that the given line has either a None data element or a data element that matches
\\d{4},\\ d{5} or [A-Za-z]+\\d{4}.
AhbLine(data_element = 0001), AhbLine(data_element = 00001) or AhbLine(data_element = R0001)
"""
if value.data_element is None:
return
Expand Down

0 comments on commit 59e8597

Please sign in to comment.