Update models.py

Set Template.name to unique. Templates with duplicate names break the loader.
This commit is contained in:
Jeremy Leipzig 2015-02-13 14:26:54 -05:00
parent b371cc6518
commit f9caea5b63

View file

@ -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'),