Properly record who deleted a comment.
authorRobert Haas <[email protected]>
Fri, 7 Aug 2009 02:20:34 +0000 (22:20 -0400)
committerRobert Haas <[email protected]>
Fri, 7 Aug 2009 02:20:34 +0000 (22:20 -0400)
perl-lib/PgCommitFest/PatchComment.pm

index e3993faf3189226f906ddd26223de7938d04bf81..0f1e3432056f6a14f5d18ad3e07bb8107579f3d0 100644 (file)
@@ -31,6 +31,12 @@ Only administrators can delete comments created by other users.
 EOM
                        }
                }
+               # 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_comment', { 'id' => $id },
+                       { 'last_updater' => $aa->{'userid'} });
                $d = $r->db->select_one(<<EOM, $id);
 DELETE FROM patch_comment WHERE id = ? RETURNING patch_id
 EOM