api: return event checked status (#67599)
This commit is contained in:
parent
ecc9c3df28
commit
a6ca69a481
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue