Commit e5cfa8e6 authored by Son Nguyen's avatar Son Nguyen Committed by Gerrit Code Review
Browse files

Merge "Delete button on User's Settings page for 'no institution'"

parents 7157e49e 5cec3fb4
......@@ -1258,9 +1258,16 @@ class User {
// Users who belong to an institution that doesn't allow
// registration cannot delete themselves.
foreach ($this->get('institutions') as $i) {
if (!$i->registerallowed) {
return false;
$institutions = $this->get('institutions');
if (empty($institutions)) {
// only in the no institution
return get_field('institution', 'registerallowed', 'name', 'mahara');
else {
foreach ($institutions as $i) {
if (!$i->registerallowed) {
return false;
return true;
......@@ -15,3 +15,4 @@ Feature: Mahara users can change their account settings
And I select "Email" from "activity_viewaccess"
And I press "Save"
Then I should see "Preferences saved"
And I should not see "Delete account"
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