diff options
author | Lukas Fleischer <lfleischer@archlinux.org> | 2020-01-30 17:15:33 +0100 |
---|---|---|
committer | Lukas Fleischer <lfleischer@archlinux.org> | 2020-02-02 12:12:42 +0100 |
commit | ee2aa9755fa3c94e8c8a697c3f7a9627027994d5 (patch) | |
tree | ab1ae6b7628036abd7ba0bb28737cf41bfb51a6b /aurweb/scripts/notify.py | |
parent | e5a839bf0b9884e2a015b3f0b3fdbf23d1a1654c (diff) | |
download | aur-ee2aa9755fa3c94e8c8a697c3f7a9627027994d5.tar.gz aur-ee2aa9755fa3c94e8c8a697c3f7a9627027994d5.tar.xz |
Add support for backup email addresses
Support secondary email addresses that can be used to recover an account
in case access to the primary email address is lost. Reset keys for an
account are always sent to both the primary and the backup email
address.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'aurweb/scripts/notify.py')
-rwxr-xr-x | aurweb/scripts/notify.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/aurweb/scripts/notify.py b/aurweb/scripts/notify.py index f2767fd8..b0f218b5 100755 --- a/aurweb/scripts/notify.py +++ b/aurweb/scripts/notify.py @@ -90,13 +90,17 @@ class Notification: class ResetKeyNotification(Notification): def __init__(self, conn, uid): - cur = conn.execute('SELECT UserName, Email, LangPreference, ' + - 'ResetKey FROM Users WHERE ID = ?', [uid]) - self._username, self._to, self._lang, self._resetkey = cur.fetchone() + cur = conn.execute('SELECT UserName, Email, BackupEmail, ' + + 'LangPreference, ResetKey ' + + 'FROM Users WHERE ID = ?', [uid]) + self._username, self._to, self._backup, self._lang, self._resetkey = cur.fetchone() super().__init__() def get_recipients(self): - return [(self._to, self._lang)] + if self._backup: + return [(self._to, self._lang), (self._backup, self._lang)] + else: + return [(self._to, self._lang)] def get_subject(self, lang): return self._l10n.translate('AUR Password Reset', lang) |