From 2aaaadcfd818ea5fbcdc65a4769e7384f4160b9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 18 Oct 2017 08:14:06 +0200 Subject: [PATCH] also consider entrouvert.org domain --- eodb/events/management/commands/common.py | 7 +++++-- 1 file 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 = {