mirror of
https://github.com/netbox-community/netbox.git
synced 2025-09-06 06:13:36 -06:00
Make CachedScopeMixin.clean() raise non-field ValidationError
This commit is contained in:
parent
545773e221
commit
c785b0409b
@ -87,11 +87,9 @@ class CachedScopeMixin(models.Model):
|
||||
def clean(self):
|
||||
if self.scope_type and not (self.scope or self.scope_id):
|
||||
scope_type = self.scope_type.model_class()
|
||||
raise ValidationError({
|
||||
'scope': _(
|
||||
"Please select a {scope_type}."
|
||||
).format(scope_type=scope_type._meta.model_name)
|
||||
})
|
||||
raise ValidationError(
|
||||
_("Please select a {scope_type}.").format(scope_type=scope_type._meta.model_name)
|
||||
)
|
||||
super().clean()
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
|
Loading…
Reference in New Issue
Block a user