1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Merge branch 'develop' of github.com:digitalocean/netbox into local-config-context

This commit is contained in:
John Anderson
2018-09-18 12:16:07 -04:00
6 changed files with 14 additions and 43 deletions

View File

@ -700,6 +700,14 @@ class ConfigContext(models.Model):
def get_absolute_url(self):
return reverse('extras:configcontext', kwargs={'pk': self.pk})
def clean(self):
# Verify that JSON data is provided as an object
if type(self.data) is not dict:
raise ValidationError(
{'data': 'JSON data must be in object form. Example: {"foo": 123}'}
)
class ConfigContextModel(models.Model):