Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added a "patches submitted" metric to the user pages.

  • Loading branch information...
commit a0422b0e2a759ee0e6aa104308a69e2ff5541f3d 1 parent 2d6f62b
@jacobian jacobian authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 django_website/trac/stats.py
View
6 django_website/trac/stats.py
@@ -6,7 +6,7 @@
import operator
import django.db
from django.utils.datastructures import SortedDict
-from .models import Revision, Ticket, TicketChange
+from .models import Revision, Ticket, TicketChange, Attachment
_statfuncs = []
@@ -52,6 +52,10 @@ def new_tickets_reviewed(username):
qs = qs.exclude(newvalue='Unreviewed')
return qs.count()
+@stat('Patches submitted')
+def patches_submitted(username):
+ return Attachment.objects.filter(author=username).count()
+
def run_single_value_query(query, *params):
"""
Helper: run a query returning a single value (e.g. a COUNT) and return the value.
Please sign in to comment.
Something went wrong with that request. Please try again.