Ejemplo n.º 1
0
def profile(request, template, user_id):
    user_profile = get_object_or_404(
        Profile, user__id=user_id, user__is_active=True)

    groups = user_profile.user.groups.all()
    return jingo.render(request, template, {
        'profile': user_profile,
        'groups': groups,
        'num_questions': user_num_questions(user_profile.user),
        'num_answers': user_num_answers(user_profile.user),
        'num_solutions': user_num_solutions(user_profile.user),
        'num_documents': user_num_documents(user_profile.user),})
Ejemplo n.º 2
0
def profile(request, template, user_id):
    user_profile = get_object_or_404(
        Profile, user__id=user_id)

    if not (request.user.has_perm('users.deactivate_users')
            or user_profile.user.is_active):
        raise Http404('No Profile matches the given query.')

    groups = user_profile.user.groups.all()
    return render(request, template, {
        'profile': user_profile,
        'groups': groups,
        'num_questions': user_num_questions(user_profile.user),
        'num_answers': user_num_answers(user_profile.user),
        'num_solutions': user_num_solutions(user_profile.user),
        'num_documents': user_num_documents(user_profile.user)})
Ejemplo n.º 3
0
def profile(request, template, user_id):
    user_profile = get_object_or_404(Profile, user__id=user_id)

    if not (request.user.has_perm('users.deactivate_users')
            or user_profile.user.is_active):
        raise Http404('No Profile matches the given query.')

    groups = user_profile.user.groups.all()
    return render(
        request, template, {
            'profile': user_profile,
            'groups': groups,
            'num_questions': user_num_questions(user_profile.user),
            'num_answers': user_num_answers(user_profile.user),
            'num_solutions': user_num_solutions(user_profile.user),
            'num_documents': user_num_documents(user_profile.user)
        })