From 5fd256e5e6e4a30ca979f9bd4edc8daf55034699 Mon Sep 17 00:00:00 2001 From: Johannes Christ Date: Sun, 23 Sep 2018 13:30:56 +0200 Subject: Add embed validation. --- api/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'api/models.py') diff --git a/api/models.py b/api/models.py index 58668c34..e84e28c0 100644 --- a/api/models.py +++ b/api/models.py @@ -4,6 +4,8 @@ from django.contrib.postgres import fields as pgfields from django.core.validators import MaxValueValidator, MinValueValidator, RegexValidator from django.db import models +from .validators import validate_tag_embed + class ModelReprMixin: """ @@ -174,5 +176,6 @@ class Tag(ModelReprMixin, models.Model): primary_key=True ) embed = pgfields.JSONField( - help_text="The actual embed shown by this tag." + help_text="The actual embed shown by this tag.", + validators=(validate_tag_embed,) ) -- cgit v1.2.3