2022-06-03 08:09:47 -06:00
|
|
|
from rest_framework.permissions import IsAuthenticated
|
|
|
|
|
from rest_framework.response import Response
|
|
|
|
|
from rest_framework.views import APIView
|
|
|
|
|
|
|
|
|
|
from apps.auth_token.auth import PluginAuthentication
|
2023-03-01 16:32:15 +08:00
|
|
|
from common.api_helpers.mixins import ALL_TEMPLATE_NAMES, NOTIFICATION_CHANNEL_OPTIONS
|
2022-06-03 08:09:47 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class PreviewTemplateOptionsView(APIView):
|
|
|
|
|
authentication_classes = (PluginAuthentication,)
|
|
|
|
|
permission_classes = (IsAuthenticated,)
|
|
|
|
|
|
|
|
|
|
def get(self, request):
|
|
|
|
|
return Response(
|
|
|
|
|
{
|
|
|
|
|
"notification_channel_options": NOTIFICATION_CHANNEL_OPTIONS,
|
2023-03-01 16:32:15 +08:00
|
|
|
"template_name_options": ALL_TEMPLATE_NAMES,
|
2022-06-03 08:09:47 -06:00
|
|
|
}
|
|
|
|
|
)
|