summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2017-10-18 06:14:06 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2017-10-18 06:14:06 (GMT)
commit2aaaadcfd818ea5fbcdc65a4769e7384f4160b9e (patch)
treefba8a8ba6d1b860456f96e78844438c57055e669
parent59c0af8e1e448f6204e3871724a4dfda8873bf34 (diff)
downloadeodb-2aaaadcfd818ea5fbcdc65a4769e7384f4160b9e.zip
eodb-2aaaadcfd818ea5fbcdc65a4769e7384f4160b9e.tar.gz
eodb-2aaaadcfd818ea5fbcdc65a4769e7384f4160b9e.tar.bz2
also consider entrouvert.org domain
-rw-r--r--eodb/events/management/commands/common.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/eodb/events/management/commands/common.py b/eodb/events/management/commands/common.py
index 24fabf4..7b18068 100644
--- a/eodb/events/management/commands/common.py
+++ b/eodb/events/management/commands/common.py
@@ -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 = {