Commit f0fe6098 authored by Michal Čihař's avatar Michal Čihař

Filter recent user changes by ACL

parent 7c158500
......@@ -31,7 +31,7 @@ from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from weblate.accounts.models import set_lang
from weblate.trans.models import Change
from weblate.trans.models import Change, Project
from weblate.accounts.forms import (
ProfileForm, SubscriptionForm, UserForm, ContactForm
)
......@@ -155,6 +155,11 @@ def user_page(request, user):
'''
user = get_object_or_404(User, username=user)
profile = user.get_profile()
acl_projects = Project.objects.all_acl(request.user)
last_changes = Change.objects.filter(
user=user,
translation__subproject__project__in=acl_projects,
)[:10]
return render_to_response(
'user.html',
RequestContext(
......@@ -162,7 +167,7 @@ def user_page(request, user):
{
'page_profile': profile,
'page_user': user,
'last_changes': Change.objects.filter(user=user)[:10],
'last_changes': last_changes,
}
)
)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment