Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mathjazz
Created January 18, 2018 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mathjazz/476b9434cd4e354135fcb18c20fbc101 to your computer and use it in GitHub Desktop.
Save mathjazz/476b9434cd4e354135fcb18c20fbc101 to your computer and use it in GitHub Desktop.
diff --git a/pontoon/teams/views.py b/pontoon/teams/views.py
index 647d95a..c74d83e 100644
--- a/pontoon/teams/views.py
+++ b/pontoon/teams/views.py
@@ -122,12 +122,9 @@ def ajax_permissions(request, locale):
translators = l.translators_group.user_set.exclude(pk__in=managers).all()
all_users = User.objects.exclude(pk__in=managers).exclude(pk__in=translators).exclude(email='')
- contributors = (
- User.translators
- .filter(translation__locale=l)
- .values_list('email', flat=True)
- .distinct()
- )
+ contributors_qs = User.translators.with_translation_counts(None, Q(locale=l))
+ contributors = set([contributor.email for contributor in contributors_qs])
+
locale_projects = l.projects_permissions
return render(request, 'teams/includes/permissions.html', {
'locale': l,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment