email_mirror: Make email_token a unique column of Stream.

This commit is contained in:
Mateusz Mandera 2019-03-17 09:37:30 +01:00 committed by Tim Abbott
parent 623ee15bee
commit a269c4bdd4
2 changed files with 22 additions and 1 deletions

View File

@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-03-17 08:37
from __future__ import unicode_literals
from django.db import migrations, models
import zerver.models
class Migration(migrations.Migration):
dependencies = [
('zerver', '0211_add_users_field_to_scheduled_email'),
]
operations = [
migrations.AlterField(
model_name='stream',
name='email_token',
field=models.CharField(default=zerver.models.generate_email_token_for_stream, max_length=32, unique=True),
),
]

View File

@ -1159,7 +1159,7 @@ class Stream(models.Model):
# e-mail length of 254, and our max stream length is 30, so we # e-mail length of 254, and our max stream length is 30, so we
# have plenty of room for the token. # have plenty of room for the token.
email_token = models.CharField( email_token = models.CharField(
max_length=32, default=generate_email_token_for_stream) # type: str max_length=32, default=generate_email_token_for_stream, unique=True) # type: str
# The very first message ID in the stream. Used to help clients # The very first message ID in the stream. Used to help clients
# determine whether they might need to display "more topics" for a # determine whether they might need to display "more topics" for a