oncall-engine/engine/apps/api/serializers/team.py
Joey Orlando 75028d0427
continue addressing mypy violations (#2170)
# What this PR does

See #2173 

Also, closes #2187 . All of the new files under `type_stubs/icalendar`
were autogenerated by running:

```bash
stubgen -p icalendar -o type_stubs
```

## 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)
2023-06-27 10:23:08 +00:00

24 lines
534 B
Python

from rest_framework import serializers
from apps.user_management.models import Team
class TeamSerializer(serializers.ModelSerializer):
id = serializers.CharField(read_only=True, source="public_primary_key")
class Meta:
model = Team
fields = (
"id",
"name",
"email",
"avatar_url",
"is_sharing_resources_to_all",
)
read_only_fields = [
"id",
"name",
"email",
"avatar_url",
]