diff options
author | Lukas Fleischer <lfleischer@archlinux.org> | 2019-11-23 18:00:52 +0100 |
---|---|---|
committer | Lukas Fleischer <lfleischer@archlinux.org> | 2019-11-23 18:30:46 +0100 |
commit | 2422fb020b79b387ef667d146cf3e0dd7b1faebf (patch) | |
tree | 4cfc7ab7f9e81ee1f6aa49dc6106a0e6960c5797 /aurweb/git | |
parent | 4b97789bab8dae01987ffa4cdeb1e1257c95834f (diff) | |
download | aur-2422fb020b79b387ef667d146cf3e0dd7b1faebf.tar.gz aur-2422fb020b79b387ef667d146cf3e0dd7b1faebf.tar.xz |
Store timestamp and user ID when closing requests
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'aurweb/git')
-rwxr-xr-x | aurweb/git/serve.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/aurweb/git/serve.py b/aurweb/git/serve.py index d43523c2..64d51b9e 100755 --- a/aurweb/git/serve.py +++ b/aurweb/git/serve.py @@ -207,18 +207,22 @@ def pkgreq_close(reqid, user, reason, comments, autoclose=False): conn = aurweb.db.Connection() if autoclose: - userid = 0 + userid = None else: cur = conn.execute("SELECT ID FROM Users WHERE Username = ?", [user]) userid = cur.fetchone()[0] if userid == 0: raise aurweb.exceptions.InvalidUserException(user) - conn.execute("UPDATE PackageRequests SET Status = ?, ClosureComment = ? " + - "WHERE ID = ?", [status, comments, reqid]) + now = int(time.time()) + conn.execute("UPDATE PackageRequests SET Status = ?, ClosedTS = ?, " + + "ClosedUID = ?, ClosureComment = ? " + + "WHERE ID = ?", [status, now, userid, comments, reqid]) conn.commit() conn.close() + if not userid: + userid = 0 subprocess.Popen((notify_cmd, 'request-close', str(userid), str(reqid), reason)).wait() |