whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: list-traffic.cgi needs who and committer, not hash
Date Mon, 22 Jul 2019 14:54:12 GMT
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 498ecef  list-traffic.cgi needs who and committer, not hash
498ecef is described below

commit 498ecef6bdac6c4d6779136a9b4c62ed45b60efe
Author: Sebb <sebb@apache.org>
AuthorDate: Mon Jul 22 15:54:08 2019 +0100

    list-traffic.cgi needs who and committer, not hash
    
    This fixes #71
    The code was broken in 2265343.
    Prior to that, it called a local method find_who_from
    which expected an email address and returned who, committer
    The version in MailUtils expects a hash which it updates
    Fix by emulating the old behaviour
---
 www/officers/list-traffic.cgi | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/www/officers/list-traffic.cgi b/www/officers/list-traffic.cgi
index 8b43f7b..3c05b4b 100755
--- a/www/officers/list-traffic.cgi
+++ b/www/officers/list-traffic.cgi
@@ -50,7 +50,13 @@ def get_mails_month(yearmonth:, nondiscuss:)
       data = {}
       data[DATE] = DateTime.parse(message[/^Date: (.*)/, 1]).iso8601
       data[FROM] = message[/^From: (.*)/, 1]
-      data[WHO], data[MailUtils::COMMITTER] = MailUtils.find_who_from(data)
+      # Originally (before 2265343) the local method #find_who_from expected an email address
and returned who, committer
+      # Emulate this with the version from MailUtils which expects and updates a hash
+      temp = {from: data[FROM]} # pass a hash
+      MailUtils.find_who_from(temp) # update the hash
+      # pick out the bits we want
+      data[WHO], data[MailUtils::COMMITTER] = temp[:who], temp[:committer] 
+
       data[SUBJECT] = message[/^Subject: (.*)/, 1]
       if nondiscuss
         nondiscuss.each do |typ, rx|


Mime
View raw message