summaryrefslogtreecommitdiff
path: root/devel
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-04-16 01:16:52 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-04-16 01:16:52 -0400
commit7aabbe788bb4e26ee9c7cfc0e18692b487e11099 (patch)
treee1032beb86e35caafb164e694d2aa7e2e9664de2 /devel
parent046e6c8b6152a8142ed838e5c406cc04c18f2533 (diff)
parent155bf43a28e404f327a7bcff214c22e212627673 (diff)
Merge branch 'archweb-generic'
Diffstat (limited to 'devel')
-rw-r--r--devel/fixtures/staff_groups.json58
-rw-r--r--devel/utils.py8
2 files changed, 64 insertions, 2 deletions
diff --git a/devel/fixtures/staff_groups.json b/devel/fixtures/staff_groups.json
new file mode 100644
index 00000000..f57baa26
--- /dev/null
+++ b/devel/fixtures/staff_groups.json
@@ -0,0 +1,58 @@
+[
+{
+ "fields": {
+ "group": [
+ "Hackers"
+ ],
+ "description": "This is a list of the current Parabola Hackers. They maintain the [libre] package repository and keep the [core], [extra], and [community] repositories clean of nonfree software, in addition to doing any other developer duties.",
+ "sort_order": 1,
+ "member_title": "Hacker",
+ "slug": "hackers",
+ "name": "Hackers"
+ },
+ "model": "devel.staffgroup",
+ "pk": 1
+},
+{
+ "fields": {
+ "group": [
+ "Retired Hackers"
+ ],
+ "description": "Below you can find a list of ex-hackers (aka project fellows). These folks helped make Parabola what it is today. Thanks!",
+ "sort_order": 11,
+ "member_title": "Fellow",
+ "slug": "hacker-fellows",
+ "name": "Hacker Fellows"
+ },
+ "model": "devel.staffgroup",
+ "pk": 3
+},
+{
+ "fields": {
+ "group": [
+ "Retired Trusted Users"
+ ],
+ "description": "Below you can find a list of ex-trusted users (aka fellows). These folks helped make Parabola what it is today. Thanks!",
+ "sort_order": 12,
+ "member_title": "Fellow",
+ "slug": "trusted-user-fellows",
+ "name": "Trusted User Fellows"
+ },
+ "model": "devel.staffgroup",
+ "pk": 4
+},
+{
+ "fields": {
+ "group": [
+ "Support Staff"
+ ],
+ "description": "These are the unheralded people that keep things running behind the scenes. Forum moderators, wiki admins, IRC moderators, mirror maintenance, and everything else that keeps a Linux distro running smoothly.",
+ "sort_order": 5,
+ "member_title": "Staff",
+ "slug": "support-staff",
+ "name": "Support Staff"
+ },
+ "model": "devel.staffgroup",
+ "pk": 5
+}
+]
diff --git a/devel/utils.py b/devel/utils.py
index eaa7d07e..3326987a 100644
--- a/devel/utils.py
+++ b/devel/utils.py
@@ -6,13 +6,16 @@ from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
from django.db import connection
from django.db.models import Count, Q
+from devel.models import UserProfile
from main.utils import cache_function
from main.models import Package
from packages.models import PackageRelation
@cache_function(283)
def get_annotated_maintainers():
- maintainers = User.objects.filter(is_active=True).order_by(
+ profile_ids = UserProfile.allowed_repos.through.objects.values('userprofile_id')
+ maintainers = User.objects.filter(
+ is_active=True, userprofile__id__in=profile_ids).order_by(
'first_name', 'last_name')
# annotate the maintainers with # of maintained and flagged packages
@@ -43,7 +46,8 @@ SELECT pr.user_id, COUNT(*), COUNT(p.flag_date)
m.flagged_count = flag_count.get(m.id, 0)
m.updated_count = update_count.get(m.id, 0)
- return maintainers
+ # force non-QS context, otherwise pickling doesn't work
+ return list(maintainers)
def ignore_does_not_exist(func):