Commit f7add6f2 authored by Brion Vibber's avatar Brion Vibber

Handle funky notice deletion cases more gracefully: if we already have a...

Handle funky notice deletion cases more gracefully: if we already have a deleted_notice entry, don't freak out when we try to save it again on the second try.
parent dc22ed84
......@@ -97,6 +97,10 @@ class Notice extends Memcached_DataObject
// For auditing purposes, save a record that the notice
// was deleted.
// @fixme we have some cases where things get re-run and so the
// insert fails.
$deleted = Deleted_notice::staticGet('id', $this->id);
if (!$deleted) {
$deleted = new Deleted_notice();
$deleted->id = $this->id;
......@@ -106,6 +110,7 @@ class Notice extends Memcached_DataObject
$deleted->deleted = common_sql_now();
$deleted->insert();
}
// Clear related records
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment