remove unique constraint on TransactionalEmail.email
This commit is contained in:
parent
8d40392b5c
commit
d9d67df126
|
@ -298,9 +298,7 @@ def send_email(
|
||||||
|
|
||||||
msg_raw = to_bytes(msg)
|
msg_raw = to_bytes(msg)
|
||||||
|
|
||||||
transaction = TransactionalEmail.get_by(email=to_email)
|
transaction = TransactionalEmail.create(email=to_email, commit=True)
|
||||||
if not transaction:
|
|
||||||
transaction = TransactionalEmail.create(email=to_email, commit=True)
|
|
||||||
|
|
||||||
# use a different envelope sender for each transactional email (aka VERP)
|
# use a different envelope sender for each transactional email (aka VERP)
|
||||||
smtp.sendmail(TRANSACTIONAL_BOUNCE_EMAIL.format(transaction.id), to_email, msg_raw)
|
smtp.sendmail(TRANSACTIONAL_BOUNCE_EMAIL.format(transaction.id), to_email, msg_raw)
|
||||||
|
|
|
@ -2421,7 +2421,7 @@ class TransactionalEmail(db.Model, ModelMixin):
|
||||||
Deleted after 7 days
|
Deleted after 7 days
|
||||||
"""
|
"""
|
||||||
|
|
||||||
email = db.Column(db.String(256), nullable=False, unique=True)
|
email = db.Column(db.String(256), nullable=False, unique=False)
|
||||||
|
|
||||||
|
|
||||||
class Payout(db.Model, ModelMixin):
|
class Payout(db.Model, ModelMixin):
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
"""empty message
|
||||||
|
|
||||||
|
Revision ID: bc75acacc98e
|
||||||
|
Revises: 7a105bfc0cd0
|
||||||
|
Create Date: 2021-09-21 11:15:15.573629
|
||||||
|
|
||||||
|
"""
|
||||||
|
import sqlalchemy_utils
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = 'bc75acacc98e'
|
||||||
|
down_revision = '7a105bfc0cd0'
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.drop_constraint('transactional_email_email_key', 'transactional_email', type_='unique')
|
||||||
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.create_unique_constraint('transactional_email_email_key', 'transactional_email', ['email'])
|
||||||
|
# ### end Alembic commands ###
|
Loading…
Reference in New Issue