Created
January 18, 2018 14:25
-
-
Save mathjazz/476b9434cd4e354135fcb18c20fbc101 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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