Skip to content

Commit 063d62f

Browse files
committed
Only send message to Valkey when project exists
1 parent f3d3a58 commit 063d62f

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

LearningAPI/views/team_maker_view.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,16 @@ def create(self, request):
170170
channel=team.slack_channel
171171
)
172172

173+
message = json.dumps({
174+
'notification_channel': cohort.slack_channel,
175+
'source_repo': "/".join(project.client_template_url.split('/')[-2:]),
176+
'all_target_repositories': issue_target_repos
177+
})
178+
valkey_client.publish('channel_migrate_issue_tickets', message)
179+
173180
serialized_team = StudentTeamSerializer(team, many=False).data
174181

175182
# Publish a message to the channel_migrate_issue_tickets channel on redis to start migrating tickets
176-
message = json.dumps({
177-
'notification_channel': cohort.slack_channel,
178-
'source_repo': "/".join(project.client_template_url.split('/')[-2:]),
179-
'all_target_repositories': issue_target_repos
180-
})
181-
valkey_client.publish('channel_migrate_issue_tickets', message)
182183

183184
return Response(serialized_team, status=status.HTTP_201_CREATED)
184185

0 commit comments

Comments
 (0)