summaryrefslogtreecommitdiff
path: root/perl-lib/PgCommitFest/Patch.pm
diff options
context:
space:
mode:
authorRobert Haas2009-07-12 03:07:05 +0000
committerRobert Haas2009-07-13 02:41:14 +0000
commitca339f3ffe2cb51e6d8a8f3419f0c9e5733943c0 (patch)
tree5ccf4fc749dd017b6c5a1b3a371e5229e18096bb /perl-lib/PgCommitFest/Patch.pm
parenta2a8a018eac6bc48731c4cb6970f53a10fa92de2 (diff)
Basic activity log for changes to patch table.
Diffstat (limited to 'perl-lib/PgCommitFest/Patch.pm')
-rw-r--r--perl-lib/PgCommitFest/Patch.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/perl-lib/PgCommitFest/Patch.pm b/perl-lib/PgCommitFest/Patch.pm
index 5ebeb42..4a769c8 100644
--- a/perl-lib/PgCommitFest/Patch.pm
+++ b/perl-lib/PgCommitFest/Patch.pm
@@ -28,10 +28,16 @@ EOM
sub delete {
my ($r) = @_;
- $r->authenticate('require_login' => 1);
+ my $aa = $r->authenticate('require_login' => 1);
$r->set_title('Delete Patch');
my $d;
eval {
+ # Don't bump last_updated_time, as that would trigger an activity log
+ # record. But do change the last_updater, so that the subsequent
+ # delete picks up the correct user id. This is a pretty ugly kludge,
+ # but I don't immediately have a better idea.
+ $r->db->update('patch', { 'id' => $r->cgi_required_id },
+ { 'last_updater' => $aa->{'userid'} });
$d = $r->db->select_one(<<EOM, $r->cgi_required_id);
DELETE FROM patch AS p
USING commitfest_topic t
@@ -132,6 +138,8 @@ EOM
# Handle commit.
if ($r->cgi('go') && ! $r->is_error()) {
+ $value{'last_updated_time'} = \'now()';
+ $value{'last_updater'} = $aa->{'userid'};
if (defined $id) {
$r->db->update('patch', { 'id' => $id }, \%value);
}