From 15b8b05889b24ad6431b889c2e26376abd053490 Mon Sep 17 00:00:00 2001 From: seba3c Date: Thu, 13 Oct 2016 22:47:04 -0300 Subject: [PATCH] Added unique const telegram bot token --- .../migrations/0004_auto_20161014_0145.py | 20 +++++++++++++++++++ notifications/telegram/models.py | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 notifications/migrations/0004_auto_20161014_0145.py diff --git a/notifications/migrations/0004_auto_20161014_0145.py b/notifications/migrations/0004_auto_20161014_0145.py new file mode 100644 index 0000000..a915182 --- /dev/null +++ b/notifications/migrations/0004_auto_20161014_0145.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.2 on 2016-10-14 01:45 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('notifications', '0003_auto_20161014_0118'), + ] + + operations = [ + migrations.AlterField( + model_name='telegrambot', + name='token', + field=models.CharField(max_length=100, unique=True), + ), + ] diff --git a/notifications/telegram/models.py b/notifications/telegram/models.py index c92ee35..4f99741 100644 --- a/notifications/telegram/models.py +++ b/notifications/telegram/models.py @@ -15,7 +15,7 @@ class TelegramBot(models.Model): name = models.CharField(max_length=25, null=False, primary_key=True) # allows more than one telegram bot implementation with the same token - token = models.CharField(max_length=100, null=False) + token = models.CharField(max_length=100, null=False, unique=True) module_name = models.CharField(max_length=25, null=True)