diff --git a/app/models/user_group.rb b/app/models/user_group.rb
index e8804b592c..e3f1599cb5 100644
--- a/app/models/user_group.rb
+++ b/app/models/user_group.rb
@@ -35,6 +35,8 @@ class UserGroup < ApplicationRecord
scope :root_groups, -> { where(parent_group: nil) }
scope :active_groups, -> { where(is_active: true) }
+ validates :active_roles, absence: true, unless: :is_active?
+
def all_child_groups
[direct_child_groups, direct_child_groups.map(&:all_child_groups)].flatten
end
diff --git a/app/webpacker/components/Panel/pages/RegionManager/index.jsx b/app/webpacker/components/Panel/pages/RegionManager/index.jsx
index 169d234f5c..b8667ff40e 100644
--- a/app/webpacker/components/Panel/pages/RegionManager/index.jsx
+++ b/app/webpacker/components/Panel/pages/RegionManager/index.jsx
@@ -22,7 +22,9 @@ const defaultRegion = {
friendlyId: '',
};
-function UserGroupVisibility({ userGroup, save, sync }) {
+function UserGroupVisibility({
+ userGroup, save, sync, setSaveError,
+}) {
const [open, setOpen] = React.useState(false);
const iconName = userGroup.is_active ? 'eye' : 'eye slash';
return (
@@ -42,6 +44,8 @@ function UserGroupVisibility({ userGroup, save, sync }) {
userGroupsUpdateUrl(userGroup.id),
{ is_active: !userGroup.is_active, is_hidden: userGroup.is_hidden },
sync,
+ {},
+ setSaveError,
);
}}
/>
@@ -76,7 +80,7 @@ export default function RegionManager() {
}, [data]);
if (loading || fetchLoading || saving) return