Finish implementing notification rules
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
|
||||
from core.forms import NotificationRuleForm, NotificationSettingsForm
|
||||
from core.models import NotificationRule, NotificationSettings
|
||||
from core.views.helpers import ObjectCreate, ObjectDelete, ObjectList, ObjectUpdate
|
||||
|
||||
from core.views.helpers import ObjectCreate, ObjectList, ObjectUpdate, ObjectDelete
|
||||
|
||||
# Notifications - we create a new notification settings object if there isn't one
|
||||
# Hence, there is only an update view, not a create view.
|
||||
@@ -28,6 +29,7 @@ class NotificationsUpdate(LoginRequiredMixin, ObjectUpdate):
|
||||
)
|
||||
return notification_settings
|
||||
|
||||
|
||||
class RuleList(LoginRequiredMixin, ObjectList):
|
||||
list_template = "partials/rule-list.html"
|
||||
model = NotificationRule
|
||||
@@ -54,4 +56,4 @@ class RuleUpdate(LoginRequiredMixin, ObjectUpdate):
|
||||
|
||||
|
||||
class RuleDelete(LoginRequiredMixin, ObjectDelete):
|
||||
model = NotificationRule
|
||||
model = NotificationRule
|
||||
|
||||
Reference in New Issue
Block a user