[aur-dev] [PATCH] notify: Fix check for 0 when sending req close notification

Johannes Löthberg johannes at kyriasis.com
Thu Jun 30 18:45:53 UTC 2016


528bf84 (Distinguish auto-accepted requests, 2016-06-30) reimplemented
sending the message saying that the request was automatically accepted,
but checks if the uid argument is false.  The argument passed from PHP
when a user didn't manually accept the request is '0' though, causing
the request to not be sent properly.

Signed-off-by: Johannes Löthberg <johannes at kyriasis.com>
---
 scripts/notify.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/scripts/notify.py b/scripts/notify.py
index ac02a01..2819728 100755
--- a/scripts/notify.py
+++ b/scripts/notify.py
@@ -385,15 +385,15 @@ def request_close(cur, uid, reqid, reason):
     text = get_request_closure_comment(cur, reqid)
 
     subject = '[PRQ#%d] Request %s' % (int(reqid), reason.title())
-    if uid:
+    if uid == '0':
+        body = 'Request #%d has been %s automatically by the Arch User ' \
+               'Repository package request system' % (int(reqid), reason)
+        refs = None
+    else:
         user = username_from_id(cur, uid)
         user_uri = aur_location + '/account/' + user + '/'
         body = 'Request #%d has been %s by %s [1]' % (int(reqid), reason, user)
         refs = '[1] ' + user_uri
-    else:
-        body = 'Request #%d has been %s automatically by the Arch User ' \
-               'Repository package request system' % (int(reqid), reason)
-        refs = None
     if text.strip() == '':
         body += '.'
     else:
-- 
2.9.0


More information about the aur-dev mailing list