Exemple #1
0
def group(request,
          name,
          template_name='datagrids/datagrid.html',
          local_site=None):
    """
    A list of review requests belonging to a particular group.
    """
    # Make sure the group exists
    group = get_object_or_404(Group, name=name, local_site=local_site)

    if not group.is_accessible_by(request.user):
        return _render_permission_denied(
            request, 'datagrids/group_permission_denied.html')

    datagrid = ReviewRequestDataGrid(
        request,
        ReviewRequest.objects.to_group(name,
                                       local_site,
                                       user=request.user,
                                       status=None,
                                       with_counts=True),
        _("Review requests for %s") % name,
        local_site=local_site)

    return datagrid.render_to_response(template_name)
Exemple #2
0
def group(request,
          name,
          template_name='datagrids/datagrid.html',
          local_site=None):
    """
    A list of review requests belonging to a particular group.
    """
    # Make sure the group exists
    group = get_object_or_404(Group, name=name, local_site=local_site)

    if not group.is_accessible_by(request.user):
        return _render_permission_denied(
            request, 'datagrids/group_permission_denied.html')

    datagrid = ReviewRequestDataGrid(
        request,
        ReviewRequest.objects.to_group(name,
                                       local_site,
                                       user=request.user,
                                       status=None,
                                       with_counts=True),
        _("Review requests for %s") % name,
        local_site=local_site)

    return datagrid.render_to_response(template_name)
Exemple #3
0
def group_members(request,
                  name,
                  template_name='datagrids/datagrid.html',
                  local_site=None):
    """Display a list of users registered for a particular group."""
    # Make sure the group exists
    group = get_object_or_404(Group, name=name, local_site=local_site)

    if not group.is_accessible_by(request.user):
        return _render_permission_denied(
            request, 'datagrids/group_permission_denied.html')

    datagrid = UsersDataGrid(request, group.users.filter(is_active=True),
                             _("Members of group %s") % name)

    return datagrid.render_to_response(template_name)
Exemple #4
0
def group_members(request,
                  name,
                  template_name='datagrids/datagrid.html',
                  local_site=None):
    """Display a list of users registered for a particular group."""
    # Make sure the group exists
    group = get_object_or_404(Group,
                              name=name,
                              local_site=local_site)

    if not group.is_accessible_by(request.user):
        return _render_permission_denied(
            request, 'datagrids/group_permission_denied.html')

    datagrid = UsersDataGrid(request,
                             group.users.filter(is_active=True),
                             _("Members of group %s") % name)

    return datagrid.render_to_response(template_name)