WIP: validators #3

Closed
dkdent wants to merge 6 commits from validators into master
Showing only changes of commit c859a735ee - Show all commits

View file

@ -11,6 +11,8 @@ def empty(field: str) -> bool:
def iso_date(field: str) -> bool:
if not field:
return False
try:
datetime.datetime.strptime(field, "%Y-%m-%d")
return True
@ -19,6 +21,10 @@ def iso_date(field: str) -> bool:
def valid_iban(field: str) -> bool:
if not field:
return False
if not type(field) == str:
return False
try:
IBAN(field)
return True
@ -27,6 +33,10 @@ def valid_iban(field: str) -> bool:
def valid_bic(field: str) -> bool:
if not field:
return False
if not type(field) == str:
return False
try:
BIC(field)
return True