summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Rustand <rustand.lars@gmail.com>2019-08-09 19:47:18 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2019-08-19 20:47:07 +0200
commita66c7fa6156b9babb81cd6a1143737a2a193634b (patch)
tree53589794006ab6313e7f8660932a785362fe7800
parent3ac958ac0167d1c1989fc09e893a578e8a22f21f (diff)
downloadaur-a66c7fa6156b9babb81cd6a1143737a2a193634b.tar.gz
aur-a66c7fa6156b9babb81cd6a1143737a2a193634b.tar.xz
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 <rustand.lars@gmail.com> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
-rwxr-xr-xaurweb/scripts/notify.py5
1 files 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