summaryrefslogtreecommitdiffstats
path: root/aurweb/git
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2019-11-23 18:00:52 +0100
committerLukas Fleischer <lfleischer@archlinux.org>2019-11-23 18:30:46 +0100
commit2422fb020b79b387ef667d146cf3e0dd7b1faebf (patch)
tree4cfc7ab7f9e81ee1f6aa49dc6106a0e6960c5797 /aurweb/git
parent4b97789bab8dae01987ffa4cdeb1e1257c95834f (diff)
downloadaur-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-xaurweb/git/serve.py10
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()