continue deleting even if user profile record is missing
This commit is contained in:
parent
ddc71b6637
commit
65766a0ebe
|
@ -670,8 +670,12 @@ class User extends Memcached_DataObject
|
||||||
|
|
||||||
function delete()
|
function delete()
|
||||||
{
|
{
|
||||||
$profile = $this->getProfile();
|
try {
|
||||||
$profile->delete();
|
$profile = $this->getProfile();
|
||||||
|
$profile->delete();
|
||||||
|
} catch (UserNoProfileException $unp) {
|
||||||
|
common_log(LOG_INFO, "User {$this->nickname} has no profile; continuing deletion.");
|
||||||
|
}
|
||||||
|
|
||||||
$related = array('Fave',
|
$related = array('Fave',
|
||||||
'Confirm_address',
|
'Confirm_address',
|
||||||
|
@ -679,6 +683,7 @@ class User extends Memcached_DataObject
|
||||||
'Foreign_link',
|
'Foreign_link',
|
||||||
'Invitation',
|
'Invitation',
|
||||||
);
|
);
|
||||||
|
|
||||||
Event::handle('UserDeleteRelated', array($this, &$related));
|
Event::handle('UserDeleteRelated', array($this, &$related));
|
||||||
|
|
||||||
foreach ($related as $cls) {
|
foreach ($related as $cls) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user