This commit is contained in:
j3d1 2024-05-09 23:09:19 +02:00
parent 7f8aee935e
commit 4a8a9fa90f
5 changed files with 37 additions and 1 deletions

View file

@ -31,5 +31,6 @@ urlpatterns = [
path('api/2/', include('mail.api_v2')), path('api/2/', include('mail.api_v2')),
path('api/2/', include('notify_sessions.api_v2')), path('api/2/', include('notify_sessions.api_v2')),
path('api/2/', include('authentication.api_v2')), path('api/2/', include('authentication.api_v2')),
path('api/2/', include('notifications.api_v2')),
path('api/', get_info), path('api/', get_info),
] ]

View file

@ -0,0 +1,15 @@
from django.contrib import admin
from notifications.models import MessageTemplate, UserNotificationChannel
class MessageTemplateAdmin(admin.ModelAdmin):
pass
class UserNotificationChannelAdmin(admin.ModelAdmin):
pass
admin.site.register(MessageTemplate, MessageTemplateAdmin)
admin.site.register(UserNotificationChannel, UserNotificationChannelAdmin)

View file

@ -0,0 +1,20 @@
from rest_framework import routers, viewsets
from notifications.models import MessageTemplate
from rest_framework import serializers
class MessageTemplateSerializer(serializers.ModelSerializer):
class Meta:
model = MessageTemplate
fields = '__all__'
class MessageTemplateViewSet(viewsets.ModelViewSet):
serializer_class = MessageTemplateSerializer
queryset = MessageTemplate.objects.all()
router = routers.SimpleRouter()
router.register(r'message_templates', MessageTemplateViewSet)
urlpatterns = ([] + router.urls)

View file

@ -4,7 +4,7 @@ from django.conf import settings
from django.db import migrations, models from django.db import migrations, models
import django.db.models.deletion import django.db.models.deletion
from notifications.defauls import auto_reply_body, new_issue_notification, reply_issue_notification from notifications.defaults import auto_reply_body, new_issue_notification, reply_issue_notification
from notifications.models import MessageTemplate from notifications.models import MessageTemplate