mirror of
https://github.com/zulip/zulip.git
synced 2025-11-11 17:36:27 +00:00
email_mirror: Make email_token a unique column of Stream.
This commit is contained in:
committed by
Tim Abbott
parent
623ee15bee
commit
a269c4bdd4
21
zerver/migrations/0212_make_stream_email_token_unique.py
Normal file
21
zerver/migrations/0212_make_stream_email_token_unique.py
Normal 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),
|
||||
),
|
||||
]
|
||||
@@ -1159,7 +1159,7 @@ class Stream(models.Model):
|
||||
# e-mail length of 254, and our max stream length is 30, so we
|
||||
# have plenty of room for the token.
|
||||
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
|
||||
# determine whether they might need to display "more topics" for a
|
||||
|
||||
Reference in New Issue
Block a user