Resolve "Reg ex field type should be able to give feedback if there was no match" #183

Merged
Owner

Closes #50

Closes #50
Author
Owner

assigned to @nik

assigned to @nik
Author
Owner

added 1 commit

  • 9286505b - Add arg to regex field type to raise an exception if no match was found

Compare with previous version

added 1 commit <ul><li>9286505b - Add arg to regex field type to raise an exception if no match was found</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-CSVImport/-/merge_requests/108/diffs?diff_id=23070&start_sha=610d82bce073ecccd1d0343a61178abdc7cd57e3)
Author
Owner

marked this merge request as ready

marked this merge request as **ready**
Owner

This should not raise RuntimeError, but the same exception type as trying to access an unmatched group.

This should not raise `RuntimeError`, but the same exception type as trying to access an unmatched group.
Author
Owner

Ok, that would be an IndexError.

Ok, that would be an `IndexError`.
Author
Owner

changed this line in version 2 of the diff

changed this line in [version 2 of the diff](/AlekSIS/official/AlekSIS-App-CSVImport/-/merge_requests/108/diffs?diff_id=23098&start_sha=9286505bc92ad1e70b264a7f46c1fb112c5402c7#109f1a1af772b7d4ac38456a0cd912e2eb4a2e76_162_162)
Author
Owner

added 1 commit

  • 6a48e539 - Add arg to regex field type to raise an exception if no match was found

Compare with previous version

added 1 commit <ul><li>6a48e539 - Add arg to regex field type to raise an exception if no match was found</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-CSVImport/-/merge_requests/108/diffs?diff_id=23098&start_sha=9286505bc92ad1e70b264a7f46c1fb112c5402c7)
Owner

Sounds reasonable. Technically, the whole pattern yields matching group 0, so the whole pattern not matching is an IndexError on accessing that group.

(Although Python for some inobvious reason breaks this contract.)

Sounds reasonable. Technically, the whole pattern yields matching group `0`, so the whole pattern not matching is an `IndexError` on accessing that group. (Although Python for some inobvious reason breaks this contract.)
Author
Owner

Then merge, please.

Then merge, please.
Author
Owner

resolved all threads

resolved all threads
Owner

mentioned in commit 1ba3c1d691

mentioned in commit 1ba3c1d69106152a6035d45145545ccd3592e4ed
nik merged commit 1ba3c1d691 into master 2022-07-24 11:30:36 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
aleksis/AlekSIS-App-CSVImport!183
No description provided.