We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aa97110 commit b6fda24Copy full SHA for b6fda24
2 files changed
openwisp_controller/config/base/device.py
@@ -128,7 +128,7 @@ def _has_config(self):
128
return hasattr(self, 'config')
129
130
def _has_group(self):
131
- return hasattr(self, 'group')
+ return hasattr(self, 'group') and self.group is not None
132
133
def _has_organization__config_settings(self):
134
return hasattr(self, 'organization') and hasattr(
openwisp_controller/config/tests/test_device.py
@@ -564,3 +564,11 @@ def test_device_org_change_limit_check(self):
564
f' for organization {org2}.'
565
),
566
)
567
+
568
+ def test_has_methods(self):
569
+ device = self._create_device(
570
+ name='11:22:33:44:55:66',
571
+ mac_address='11:22:33:44:55:66',
572
+ organization=self._get_org(),
573
+ )
574
+ self.assertFalse(device._has_group())
0 commit comments