06/11 Set it default to notify admin & director when new issue created
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
"""phase24 — enable issue_created notifications for admin and director by default
|
||||
|
||||
Sets enabled=True for ('issue_created', 'admin') and ('issue_created', 'director')
|
||||
in the notification_matrix table if those rows already exist (created when an admin
|
||||
previously saved the matrix page). Rows that do not exist are left alone — the
|
||||
updated MATRIX_DEFAULTS in notification_matrix.py covers those at runtime.
|
||||
"""
|
||||
|
||||
from alembic import op
|
||||
|
||||
revision = 'phase24_issue_created_notify_defaults'
|
||||
down_revision = 'phase23_support_tickets'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.execute("""
|
||||
UPDATE notification_matrix
|
||||
SET enabled = 1
|
||||
WHERE event_type = 'issue_created'
|
||||
AND role_key IN ('admin', 'director')
|
||||
""")
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.execute("""
|
||||
UPDATE notification_matrix
|
||||
SET enabled = 0
|
||||
WHERE event_type = 'issue_created'
|
||||
AND role_key IN ('admin', 'director')
|
||||
""")
|
||||
Reference in New Issue
Block a user