# What this PR does Follow up PR to https://github.com/grafana/oncall/pull/5199 and https://github.com/grafana/oncall/pull/5224, addresses a few issues I noticed on dev while testing the feature ## Checklist - [x] Unit, integration, and e2e (if applicable) tests updated - [x] Documentation added (or `pr:no public docs` PR label added if not required) - [x] Added the relevant release notes label (see labels prefixed w/ `release:`). These labels dictate how your PR will show up in the autogenerated release notes.
21 lines
550 B
Python
21 lines
550 B
Python
import typing
|
|
|
|
from rest_framework import serializers
|
|
|
|
from apps.slack.models import SlackChannel
|
|
|
|
|
|
class SlackChannelDetails(typing.TypedDict):
|
|
display_name: str
|
|
slack_id: str
|
|
id: str
|
|
|
|
|
|
class SlackChannelSerializer(serializers.ModelSerializer):
|
|
id = serializers.CharField(read_only=True, source="public_primary_key")
|
|
display_name = serializers.CharField(source="name")
|
|
|
|
class Meta:
|
|
model = SlackChannel
|
|
fields = ["id", "display_name", "slack_id"]
|
|
read_only_fields = ["id", "display_name", "slack_id"]
|