api: return event checked status (#67599)

This commit is contained in:
Valentin Deniaud 2022-07-21 11:44:22 +02:00
parent ecc9c3df28
commit a6ca69a481
2 changed files with 6 additions and 0 deletions

View File

@ -498,6 +498,7 @@ def get_event_detail(
'pricing': event.pricing,
'url': event.url,
'duration': event.duration,
'checked': event.checked,
}
for key, value in event.get_custom_fields().items():
details['custom_field_%s' % key] = value

View File

@ -52,6 +52,7 @@ def test_status(app, user):
'url': None,
'disabled': False,
'duration': None,
'checked': False,
'api': {
'bookings_url': 'http://testserver/api/agenda/foo-bar/bookings/event-slug/',
'fillslot_url': 'http://testserver/api/agenda/foo-bar/fillslot/event-slug/',
@ -88,6 +89,7 @@ def test_status(app, user):
'url': None,
'disabled': False,
'duration': None,
'checked': False,
'custom_field_text': 'foo',
'custom_field_textarea': 'foo bar',
'custom_field_bool': True,
@ -164,6 +166,9 @@ def test_event_checked(app, user):
event.refresh_from_db()
assert event.checked is True
resp = app.get('/api/agenda/%s/status/%s/' % (agenda.slug, event.slug))
assert resp.json['checked'] is True
# already checked
app.post('/api/agenda/%s/check/%s/' % (agenda.slug, event.slug))
event.refresh_from_db()