Exemplo n.º 1
0
def user(request):
    users = Dojo_User.objects.all().order_by('username', 'last_name',
                                             'first_name')
    users = UserFilter(request.GET, queryset=users)
    paged_users = get_page_items(request, users, 25)
    add_breadcrumb(title="All Users", top_level=True, request=request)
    return render(request, 'dojo/users.html', {
        "users": paged_users,
        "filtered": users,
        "name": "All Users",
    })
Exemplo n.º 2
0
def engineer_metrics(request):
    # only superusers can select other users to view
    if request.user.is_superuser:
        users = Dojo_User.objects.all().order_by('username')
    else:
        return HttpResponseRedirect(
            reverse('view_engineer', args=(request.user.id, )))

    users = UserFilter(request.GET, queryset=users)
    paged_users = get_page_items(request, users.qs, 25)

    add_breadcrumb(title="Engineer Metrics", top_level=True, request=request)

    return render(request, 'dojo/engineer_metrics.html', {
        'users': paged_users,
        "filtered": users,
    })