'Identify all users who are participating with a given issue.'

def get_participants(self, group):

    from sentry.models import User, UserOption, UserOptionValue
    users = User.objects.filter(sentry_orgmember_set__teams=group.project.team, is_active=True)
    users = users.exclude(id__in=GroupSubscription.objects.filter(group=group, is_active=False, user__in=users).values('user'))
    participants = {subscription.user: subscription.reason for subscription in GroupSubscription.objects.filter(group=group, is_active=True, user__in=users).select_related('user')}
    participating_only = set((uo.user_id for uo in UserOption.objects.filter((Q(project__isnull=True) | Q(project=group.project)), user__in=users, key='workflow:notifications').exclude(user__in=[uo.user_id for uo in UserOption.objects.filter(project=group.project, user__in=users, key='workflow:notifications') if (uo.value == UserOptionValue.all_conversations)]) if (uo.value == UserOptionValue.participating_only)))
    if participating_only:
        excluded = participating_only.difference(participants.keys())
        if excluded:
            users = users.exclude(id__in=excluded)
    results = {}
    for user in users:
        results[user] = GroupSubscriptionReason.implicit
    for (user, reason) in participants.items():
        results[user] = reason
    return results
