stash
This commit is contained in:
parent
7f8aee935e
commit
4a8a9fa90f
5 changed files with 37 additions and 1 deletions
|
@ -31,5 +31,6 @@ urlpatterns = [
|
|||
path('api/2/', include('mail.api_v2')),
|
||||
path('api/2/', include('notify_sessions.api_v2')),
|
||||
path('api/2/', include('authentication.api_v2')),
|
||||
path('api/2/', include('notifications.api_v2')),
|
||||
path('api/', get_info),
|
||||
]
|
||||
|
|
15
core/notifications/admin.py
Normal file
15
core/notifications/admin.py
Normal 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)
|
20
core/notifications/api_v2.py
Normal file
20
core/notifications/api_v2.py
Normal 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)
|
|
@ -4,7 +4,7 @@ from django.conf import settings
|
|||
from django.db import migrations, models
|
||||
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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue