Skip to content

Commit 875f9fc

Browse files
committed
Set is_active=TRUE on new broadcasts
1 parent db8bc56 commit 875f9fc

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

core/models/msgs.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -853,8 +853,8 @@ type broadcastGroup struct {
853853

854854
const insertBroadcastSQL = `
855855
INSERT INTO
856-
msgs_broadcast( org_id, parent_id, ticket_id, created_on, modified_on, status, text, base_language, send_all)
857-
VALUES(:org_id, :parent_id, :ticket_id, NOW() , NOW(), 'Q', :text, :base_language, FALSE)
856+
msgs_broadcast( org_id, parent_id, ticket_id, created_on, modified_on, status, text, base_language, send_all, is_active)
857+
VALUES(:org_id, :parent_id, :ticket_id, NOW() , NOW(), 'Q', :text, :base_language, FALSE, TRUE)
858858
RETURNING
859859
id
860860
`

mailroom_test.dump

13.1 KB
Binary file not shown.

testsuite/testdata/msgs.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ func InsertBroadcast(db *sqlx.DB, org *Org, baseLanguage envs.Language, text map
8080

8181
var id models.BroadcastID
8282
must(db.Get(&id,
83-
`INSERT INTO msgs_broadcast(org_id, base_language, text, schedule_id, status, send_all, created_on, modified_on, created_by_id, modified_by_id)
84-
VALUES($1, $2, $3, $4, 'P', TRUE, NOW(), NOW(), 1, 1) RETURNING id`, org.ID, baseLanguage, hstore.Hstore{Map: textMap}, schedID,
83+
`INSERT INTO msgs_broadcast(org_id, base_language, text, schedule_id, status, send_all, created_on, modified_on, created_by_id, modified_by_id, is_active)
84+
VALUES($1, $2, $3, $4, 'P', TRUE, NOW(), NOW(), 1, 1, TRUE) RETURNING id`, org.ID, baseLanguage, hstore.Hstore{Map: textMap}, schedID,
8585
))
8686

8787
for _, contact := range contacts {

0 commit comments

Comments
 (0)