Make source label field unique.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2018-08-04 00:06:03 -04:00
parent 71ada209f6
commit 3aecf817ce
2 changed files with 23 additions and 1 deletions
+3 -1
View File
@@ -51,7 +51,9 @@ logger = logging.getLogger(__name__)
@python_2_unicode_compatible
class Source(models.Model):
label = models.CharField(max_length=64, verbose_name=_('Label'))
label = models.CharField(
db_index=True, max_length=64, unique=True, verbose_name=_('Label')
)
enabled = models.BooleanField(default=True, verbose_name=_('Enabled'))
objects = InheritanceManager()