-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable submission of repayment requests
- Loading branch information
1 parent
545e577
commit a036333
Showing
4 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from marshmallow import fields, ValidationError | ||
from schwifty import IBAN | ||
|
||
|
||
class IBANField(fields.Field): | ||
"""Field that serializes to a IBAN and deserializes | ||
to a string. | ||
""" | ||
|
||
def _deserialize(self, value, attr, data, **kwargs) -> IBAN: | ||
try: | ||
return IBAN(value) | ||
except ValueError as error: | ||
raise ValidationError("Pin codes must contain only digits.") from error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,3 +40,4 @@ sentry-sdk[Flask]~=1.29.2 | |
-e ./deps/wtforms-widgets/ | ||
python-dotenv~=0.21.0 | ||
pydantic~=2.0.0 | ||
schwifty~=2023.9.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters