also consider entrouvert.org domain

This commit is contained in:
Frédéric Péters 2017-10-18 08:14:06 +02:00
parent 59c0af8e1e
commit 2aaaadcfd8
1 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,7 @@
import matplotlib.pyplot as plt
from django.core.management.base import BaseCommand, CommandError
from django.db.models import Q
from django.utils.dateparse import parse_date
from eodb.events.models import Commit, Email, Redmine
@ -39,7 +40,9 @@ class GraphCommand(BaseCommand):
yield (None, self.get_events(options))
def get_events(self, options):
filters = {'author_email__endswith': '@entrouvert.com'}
domain_filter = Q(author_email__endswith='@entrouvert.com') | \
Q(author_email__endswith='@entrouvert.org')
filters = {}
if options.get('username'):
filters['author_email__startswith'] = options['username'] + '@'
@ -56,7 +59,7 @@ class GraphCommand(BaseCommand):
filters[datetime_var + '__lt'] = parse_date(options['datemax'])
return {'emails': Email, 'redmine': Redmine, 'git': Commit}[
options['events']].objects.filter(**filters)
options['events']].objects.filter(domain_filter).filter(**filters)
def get_title(self, options):
title = {