From a66c7fa6156b9babb81cd6a1143737a2a193634b Mon Sep 17 00:00:00 2001 From: Lars Rustand Date: Fri, 9 Aug 2019 19:47:18 +0200 Subject: notify.py: Use a/an correctly when sending request notifications Will no longer send notifications about "a orphan request", but determine whether to use a/an based on the first character of the request type. Signed-off-by: Lars Rustand Signed-off-by: Lukas Fleischer --- aurweb/scripts/notify.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aurweb/scripts/notify.py b/aurweb/scripts/notify.py index d9750862..591b5ca4 100755 --- a/aurweb/scripts/notify.py +++ b/aurweb/scripts/notify.py @@ -414,8 +414,9 @@ class RequestOpenNotification(Notification): (self._user, self._pkgbase, self._merge_into) body += '\n\n' + self._text else: - body = '%s [1] filed a %s request for %s [2]:' % \ - (self._user, self._reqtype, self._pkgbase) + an = 'an' if self._reqtype[0] in 'aeiou' else 'a' + body = '%s [1] filed %s %s request for %s [2]:' % \ + (self._user, an, self._reqtype, self._pkgbase) body += '\n\n' + self._text return body -- cgit v1.2.3-24-g4f1b