This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
2019-10-28 13:44:46 +00:00
|
|
|
"""Invitation API Views"""
|
2019-10-28 13:27:43 +00:00
|
|
|
from rest_framework.serializers import ModelSerializer
|
|
|
|
from rest_framework.viewsets import ModelViewSet
|
|
|
|
|
|
|
|
from passbook.core.models import Invitation
|
|
|
|
|
|
|
|
|
|
|
|
class InvitationSerializer(ModelSerializer):
|
2019-10-28 13:44:46 +00:00
|
|
|
"""Invitation Serializer"""
|
2019-10-28 13:27:43 +00:00
|
|
|
|
|
|
|
class Meta:
|
|
|
|
|
|
|
|
model = Invitation
|
2019-12-31 11:51:16 +00:00
|
|
|
fields = [
|
|
|
|
"pk",
|
|
|
|
"expires",
|
|
|
|
"fixed_username",
|
|
|
|
"fixed_email",
|
|
|
|
"needs_confirmation",
|
|
|
|
]
|
2019-10-28 13:27:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
class InvitationViewSet(ModelViewSet):
|
2019-10-28 13:44:46 +00:00
|
|
|
"""Invitation Viewset"""
|
2019-10-28 13:27:43 +00:00
|
|
|
|
|
|
|
queryset = Invitation.objects.all()
|
|
|
|
serializer_class = InvitationSerializer
|