mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
* Translations cleanup * Tweak variable names; misc string cleanup * Misc cleanup
This commit is contained in:
@ -135,10 +135,9 @@ class Cluster(ContactsMixin, PrimaryModel):
|
||||
|
||||
# If the Cluster is assigned to a Site, verify that all host Devices belong to that Site.
|
||||
if self.pk and self.site:
|
||||
nonsite_devices = Device.objects.filter(cluster=self).exclude(site=self.site).count()
|
||||
if nonsite_devices:
|
||||
if nonsite_devices := Device.objects.filter(cluster=self).exclude(site=self.site).count():
|
||||
raise ValidationError({
|
||||
'site': _("{} devices are assigned as hosts for this cluster but are not in site {}").format(
|
||||
nonsite_devices, self.site
|
||||
)
|
||||
'site': _(
|
||||
"{count} devices are assigned as hosts for this cluster but are not in site {site}"
|
||||
).format(count=nonsite_devices, site=self.site)
|
||||
})
|
||||
|
Reference in New Issue
Block a user