toulouse-maelis: correct bool input on WS (#72523)
This commit is contained in:
parent
4e0d8c3222
commit
bfbc32b0db
|
@ -371,6 +371,8 @@ class ToulouseMaelis(BaseResource, HTTPResource):
|
|||
data = post_data
|
||||
for key in keys:
|
||||
data = data[key]
|
||||
if 'isAuthHospital' in data:
|
||||
data['isAuthHospital'] = self.encode_bool(data['isAuthHospital'])
|
||||
|
||||
for i in range(0, len(data.get('vaccinList', []))):
|
||||
self.assert_post_data_in_referential(
|
||||
|
@ -396,6 +398,9 @@ class ToulouseMaelis(BaseResource, HTTPResource):
|
|||
data = post_data
|
||||
for key in keys:
|
||||
data = data[key]
|
||||
for key in ('bPhoto', 'bLeaveAlone'):
|
||||
if key in data:
|
||||
data[key] = self.encode_bool(data[key])
|
||||
|
||||
if 'dietcode' in data:
|
||||
self.assert_post_data_in_referential('DietCode', post_data, keys + ['dietcode'], required=False)
|
||||
|
@ -425,6 +430,15 @@ class ToulouseMaelis(BaseResource, HTTPResource):
|
|||
)
|
||||
self.assert_post_data_in_referential('Organ', post_data, keys + ['CAFInfo', 'organ'], required=False)
|
||||
|
||||
data = post_data
|
||||
for key in keys:
|
||||
data = data[key]
|
||||
if 'contact' in data:
|
||||
data = data['contact']
|
||||
for key in ('isContactMail', 'isContactSms', 'isInvoicePdf'):
|
||||
if key in data:
|
||||
data[key] = self.encode_bool(data[key])
|
||||
|
||||
def assert_rl_payload_in_referential(self, post_data, parent_keys=None):
|
||||
keys = parent_keys or []
|
||||
self.assert_post_data_in_referential('Civility', post_data, keys + ['civility'])
|
||||
|
@ -450,6 +464,8 @@ class ToulouseMaelis(BaseResource, HTTPResource):
|
|||
)
|
||||
for i in range(0, len(post_data.get('childList') or [])):
|
||||
self.assert_child_payload_in_referential(post_data, ['childList', i])
|
||||
if 'flagCom' in post_data:
|
||||
post_data['flagCom'] = self.encode_bool(post_data['flagCom'])
|
||||
|
||||
def replace_null_values(self, dico):
|
||||
'''send null fields as empty SOAP tag to tell maelis to empty the value'''
|
||||
|
@ -1481,7 +1497,7 @@ class ToulouseMaelis(BaseResource, HTTPResource):
|
|||
self.assert_child_pai_payoad_in_referential(post_data)
|
||||
|
||||
# use None to empty date passed as an empty string by date filter
|
||||
for key in 'dateDeb', 'dateFin':
|
||||
for key in ('dateDeb', 'dateFin'):
|
||||
if post_data[key] == '':
|
||||
post_data[key] = None
|
||||
|
||||
|
|
|
@ -1262,6 +1262,7 @@ def test_create_family(family_service, con, app):
|
|||
params = {
|
||||
'category': 'ACCEUI',
|
||||
'situation': 'C',
|
||||
'flagCom': False,
|
||||
'rl1/civility': 'M.',
|
||||
'rl1/firstname': 'Jhon',
|
||||
'rl1/lastname': 'Doe',
|
||||
|
@ -1275,6 +1276,7 @@ def test_create_family(family_service, con, app):
|
|||
'rl1/adresse/town': 'Paris',
|
||||
'rl1/adresse/zipcode': '75014',
|
||||
'rl1/adresse/numComp': 'B',
|
||||
'rl1/contact/isContactMail': True,
|
||||
'rl1/profession/codeCSP': 'ART',
|
||||
'rl1/CAFInfo/organ': 'A10007752822',
|
||||
'emergencyPersonList/0/civility': 'MME',
|
||||
|
@ -2156,6 +2158,7 @@ def test_update_coordinate(family_service, con, app):
|
|||
'adresse/street2': None,
|
||||
'adresse/town': 'Paris',
|
||||
'adresse/zipcode': '75014',
|
||||
'contact/isContactMail': True,
|
||||
'profession/codeCSP': 'ART',
|
||||
'profession/profession': 'informaticien',
|
||||
'profession/employerName': 'EO',
|
||||
|
|
Loading…
Reference in New Issue