clicrdv: fix fiche attribution (#39313)
This commit is contained in:
parent
bc2e5d769e
commit
f1a89c5cd2
|
@ -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()
|
||||
|
|
|
@ -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']
|
||||
|
|
Loading…
Reference in New Issue