clicrdv: fix fiche attribution (#39313)
gitea-wip/passerelle/pipeline/head There was a failure building this commit Details
gitea/passerelle/pipeline/head Something is wrong with the build of this commit Details

This commit is contained in:
Serghei Mihai 2020-01-27 18:54:39 +01:00 committed by Frédéric Péters
parent bc2e5d769e
commit f1a89c5cd2
2 changed files with 2 additions and 1 deletions

View File

@ -184,7 +184,7 @@ class ClicRdv(BaseResource):
# optional parameters, if any...
for fieldname in (fields.keys() + extra.keys() + data.keys()):
if fieldname.startswith('clicrdv_fiche_'):
appointment['fiche'][fieldname[14:]] = get_data(fieldname) or ''
appointment['appointment']['fiche'][fieldname[14:]] = get_data(fieldname) or ''
try:
r = self.request('appointments', 'post', json=appointment)
r.raise_for_status()

View File

@ -191,6 +191,7 @@ def test_failed_appointment_creation(mocked_request, app, connector):
apiuser=apiuser)
data = {'fields': {'clicrdv_date_raw': '2017-01-01' , 'clicrdv_time_raw': '12:00:00',
'clicrdv_fiche_str10': 'Test',
'firstname': 'Foo', 'lastname': 'Bar', 'email': 'foobar@example.com'}}
resp = app.post_json('/clicrdv/test/interventions/63258/create?apikey=apiuser', params=data).json
assert resp['data']