Avoid confirm dialog while profiles are assigned to user

This commit is contained in:
fbsanchez 2020-11-03 10:08:23 +01:00
parent 95ed4c9665
commit 8b01565948
1 changed files with 10 additions and 6 deletions

View File

@ -1393,12 +1393,16 @@ $(document).ready (function () {
// Admin does not require profiles.
$('#user_profile_form').submit();
} else {
confirmDialog({
message: "<?php echo __('User will be created without profiles assigned and won\'t be able to log in, are you sure?'); ?>",
onAccept: function() {
$('#user_profile_form').submit();
}
});
if ($('#table_profiles tbody').children().length == 1) {
confirmDialog({
message: "<?php echo __('User will be created without profiles assigned and won\'t be able to log in, are you sure?'); ?>",
onAccept: function() {
$('#user_profile_form').submit();
}
});
} else {
$('#user_profile_form').submit();
}
}
});
});