def get_gid_list(user=None, include_default=True):
    if HAS_GRP is False or HAS_PWD is False:
        # We don't work on platforms that don't have grp and pwd
        # Just return an empty list
        return []
    gid_list = [
            gid for (group, gid) in
            six.iteritems(salt.utils.get_group_dict(user, include_default=include_default))
    ]
    return sorted(set(gid_list))
View should redirect to return_url if it is in POST values.
dataset/ETHPy150Open saltstack/salt/salt/utils/__init__.py/get_gid_list--crossover with--dataset/ETHPy150Open ofa/connect/open_connect/notifications/tests/test_views.py/SubscriptionUpdateViewTest.test_success_url_return_url_in_post