def METHOD_NAME(self, submission, reviewer):
    groups = set(reviewer.groups.values_list('name', flat=True)) & set(REVIEW_GROUPS)
    if len(groups) > 1:
        if COMMUNITY_REVIEWER_GROUP_NAME in groups:
            groups = {COMMUNITY_REVIEWER_GROUP_NAME}
        elif reviewer.is_apply_staff:
            groups = {STAFF_GROUP_NAME}
        else:
            groups = {REVIEWER_GROUP_NAME}
    elif not groups:
        if reviewer.is_staff or reviewer.is_superuser:
            groups = {STAFF_GROUP_NAME}
        else:
            groups = {REVIEWER_GROUP_NAME}
    group = Group.objects.get(name=groups.pop())
    return self.get_or_create(
        submission=submission,
        reviewer=reviewer,
        defaults={'type': group},
    )