api: fix datetimes for multiple agendas when no subscriptions & overlaps (#76217)
gitea/chrono/pipeline/head This commit looks good
Details
gitea/chrono/pipeline/head This commit looks good
Details
This commit is contained in:
parent
e60bb3080d
commit
f28031f5a2
|
@ -934,6 +934,7 @@ class MultipleAgendasDatetimes(APIView):
|
||||||
check_overlaps = bool(payload.get('check_overlaps'))
|
check_overlaps = bool(payload.get('check_overlaps'))
|
||||||
|
|
||||||
entries = Event.objects.none()
|
entries = Event.objects.none()
|
||||||
|
if agendas:
|
||||||
for agenda in agendas:
|
for agenda in agendas:
|
||||||
if show_past_events:
|
if show_past_events:
|
||||||
entries |= agenda.get_past_events(
|
entries |= agenda.get_past_events(
|
||||||
|
|
|
@ -1695,3 +1695,10 @@ def test_datetimes_multiple_agendas_overlapping_events(app):
|
||||||
|
|
||||||
resp = app.get('/api/agendas/datetimes/', params={'agendas': 'foo-bar,foo-bar-2'})
|
resp = app.get('/api/agendas/datetimes/', params={'agendas': 'foo-bar,foo-bar-2'})
|
||||||
assert ['overlaps' not in x for x in resp.json['data']]
|
assert ['overlaps' not in x for x in resp.json['data']]
|
||||||
|
|
||||||
|
# no subscription found for this user
|
||||||
|
resp = app.get(
|
||||||
|
'/api/agendas/datetimes/',
|
||||||
|
params={'subscribed': 'all', 'user_external_id': 'xxx', 'check_overlaps': True},
|
||||||
|
)
|
||||||
|
assert len(resp.json['data']) == 0
|
||||||
|
|
Loading…
Reference in New Issue