diff options
-rw-r--r-- | packages/management/commands/signoff_report.py | 4 | ||||
-rw-r--r-- | templates/packages/signoff_report.txt | 13 |
2 files changed, 11 insertions, 6 deletions
diff --git a/packages/management/commands/signoff_report.py b/packages/management/commands/signoff_report.py index 3431dada..3357bc1e 100644 --- a/packages/management/commands/signoff_report.py +++ b/packages/management/commands/signoff_report.py @@ -69,6 +69,10 @@ def generate_report(email, repo_name): new_cutoff = now - timedelta(hours=new_hours) old_cutoff = now - timedelta(days=old_days) + if len(signoff_groups) == 0: + # no need to send an email at all + return + for group in signoff_groups: spec = group.specification if spec.known_bad: diff --git a/templates/packages/signoff_report.txt b/templates/packages/signoff_report.txt index 81020c8f..046c2f1e 100644 --- a/templates/packages/signoff_report.txt +++ b/templates/packages/signoff_report.txt @@ -14,27 +14,28 @@ pkgbase, architecture, and repository; e.g., one PKGBUILD produces one package per architecture, even if it is a split package.) -== New packages in [{{ repo|lower}}] in last {{ new_hours }} hours ({{ new|length }} total) == +{% if new %}== New packages in [{{ repo|lower}}] in last {{ new_hours }} hours ({{ new|length }} total) == {% for group in new %} * {{ group.pkgbase }}-{{ group.version }} ({{ group.arch }}){% endfor %} -{% regroup incomplete by target_repo as by_repo %}{% for target_repo in by_repo %} +{% endif %}{% regroup incomplete by target_repo as by_repo %}{% for target_repo in by_repo %} == Incomplete signoffs for [{{ target_repo.grouper|lower }}] ({{ target_repo.list|length }} total) == {% for group in target_repo.list %} * {{ group.pkgbase }}-{{ group.version }} ({{ group.arch }}) {{ group.completed }}/{{ group.required }} signoffs{% endfor %} {% endfor %} -== Completed signoffs ({{ complete|length }} total) == +{% if complete %}== Completed signoffs ({{ complete|length }} total) == {% for group in complete %} * {{ group.pkgbase }}-{{ group.version }} ({{ group.arch }}){% endfor %} -== All packages in [{{ repo|lower }}] for more than {{ old_days }} days ({{ old|length }} total) == +{% endif %}{% if old %}== All packages in [{{ repo|lower }}] for more than {{ old_days }} days ({{ old|length }} total) == {% for group in old %} * {{ group.pkgbase }}-{{ group.version }} ({{ group.arch }}), since {{ group.last_update|date }}{% endfor %} -{% endautoescape %} -== Top five in signoffs in last {{ new_hours }} hours == + +{% endif %}== Top five in signoffs in last {{ new_hours }} hours == {% for leader in leaders %} {{ forloop.counter }}. {{ leader.user }} - {{ leader.count }} signoffs{% endfor %} +{% endautoescape %} |