Merge pull request #603 from grafana/matiasb/fix-empty-schedule-related-users
Fix related_users for no-shifts schedule
This commit is contained in:
commit
802a114889
2 changed files with 14 additions and 0 deletions
|
|
@ -654,6 +654,7 @@ class OnCallScheduleWeb(OnCallSchedule):
|
|||
for g in rolling_groups
|
||||
if g is not None
|
||||
),
|
||||
set(),
|
||||
)
|
||||
return users
|
||||
|
||||
|
|
|
|||
|
|
@ -745,6 +745,19 @@ def test_preview_override_shift(make_organization, make_user_for_organization, m
|
|||
assert schedule._ical_file_overrides == schedule_overrides_ical
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_schedule_related_users_empty_schedule(make_organization, make_schedule):
|
||||
organization = make_organization()
|
||||
schedule = make_schedule(
|
||||
organization,
|
||||
schedule_class=OnCallScheduleWeb,
|
||||
name="test_web_schedule",
|
||||
)
|
||||
|
||||
users = schedule.related_users()
|
||||
assert users == set()
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_schedule_related_users(make_organization, make_user_for_organization, make_on_call_shift, make_schedule):
|
||||
organization = make_organization()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue