Skip to content
Snippets Groups Projects
Commit 9c457f49 authored by Jared Hancock's avatar Jared Hancock
Browse files

orgs: Unset primary contact when user is removed

parent 3f3b2252
No related branches found
No related tags found
No related merge requests found
......@@ -379,7 +379,7 @@ class UsersAjaxAPI extends AjaxController {
} elseif ($orgId)
$org = Organization::lookup($orgId);
elseif ($org = $user->getOrganization()) {
$info['title'] = $org->getName();
$info['title'] = sprintf('%s — %s', $user->getName(), 'Organization');
$info['action'] = $info['onselect'] = '';
$tmpl = 'org.tmpl.php';
}
......
......@@ -212,13 +212,13 @@ class Organization extends OrganizationModel {
if (!$user instanceof User)
return false;
if (!$user->setOrganization(null))
if (!$user->setOrganization(null, false))
return false;
// TODO: house cleaning - remove user from org contact..etc
// House cleaning - remove user from org contact..etc
$user->setPrimaryContact(false);
return true;
return $user->save();
}
function to_json() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment