Switch database location and use mixins for CRUD
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin
|
||||
from django.shortcuts import render
|
||||
from mixins.views import ObjectCreate, ObjectDelete, ObjectList, ObjectUpdate
|
||||
from rest_framework.views import APIView
|
||||
|
||||
from core.db.storage import db
|
||||
from core.forms import NotificationRuleForm, NotificationSettingsForm
|
||||
from core.lib.rules import NotificationRuleData
|
||||
from core.models import NotificationRule, NotificationSettings
|
||||
from core.views.helpers import ObjectCreate, ObjectDelete, ObjectList, ObjectUpdate
|
||||
|
||||
|
||||
# Notifications - we create a new notification settings object if there isn't one
|
||||
@@ -70,7 +70,7 @@ class RuleClear(LoginRequiredMixin, PermissionRequiredMixin, APIView):
|
||||
permission_required = "use_rules"
|
||||
|
||||
def post(self, request, type, pk):
|
||||
template_name = "partials/notify.html"
|
||||
template_name = "mixins/partials/notify.html"
|
||||
rule = NotificationRule.objects.get(pk=pk, user=request.user)
|
||||
if isinstance(rule.match, dict):
|
||||
for index in rule.match:
|
||||
|
||||
Reference in New Issue
Block a user