Fix integrations options order (#2204)
# What this PR does ## Which issue(s) this PR fixes ## Checklist - [ ] Unit, integration, and e2e (if applicable) tests updated - [ ] Documentation added (or `pr:no public docs` PR label added if not required) - [ ] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not required)
This commit is contained in:
parent
072d43c3d2
commit
952df67580
1 changed files with 3 additions and 2 deletions
|
|
@ -187,6 +187,7 @@ class AlertReceiveChannelView(
|
|||
@action(detail=False, methods=["get"])
|
||||
def integration_options(self, request):
|
||||
choices = []
|
||||
featured_choices = []
|
||||
for integration_id, integration_title in AlertReceiveChannel.INTEGRATION_CHOICES:
|
||||
if integration_id in AlertReceiveChannel.WEB_INTEGRATION_CHOICES:
|
||||
choice = {
|
||||
|
|
@ -200,10 +201,10 @@ class AlertReceiveChannelView(
|
|||
}
|
||||
# if integration is featured we show it in the beginning
|
||||
if choice["featured"]:
|
||||
choices = [choice] + choices
|
||||
featured_choices.append(choice)
|
||||
else:
|
||||
choices.append(choice)
|
||||
return Response(choices)
|
||||
return Response(featured_choices + choices)
|
||||
|
||||
@action(detail=True, methods=["put"])
|
||||
def change_team(self, request, pk):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue