From f9caea5b6339296cb5a43acc409be2b98805169b Mon Sep 17 00:00:00 2001 From: Jeremy Leipzig Date: Fri, 13 Feb 2015 14:26:54 -0500 Subject: [PATCH] Update models.py Set Template.name to unique. Templates with duplicate names break the loader. --- dbtemplates/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbtemplates/models.py b/dbtemplates/models.py index 02e8081..c1859b8 100644 --- a/dbtemplates/models.py +++ b/dbtemplates/models.py @@ -23,7 +23,7 @@ class Template(models.Model): Defines a template model for use with the database template loader. The field ``name`` is the equivalent to the filename of a static template. """ - name = models.CharField(_('name'), max_length=100, + name = models.CharField(_('name'), max_length=100, unique=True, help_text=_("Example: 'flatpages/default.html'")) content = models.TextField(_('content'), blank=True) sites = models.ManyToManyField(Site, verbose_name=_(u'sites'),