From 9ca768f05d4a55238b1b84dc3e1861e72c4d9e2c Mon Sep 17 00:00:00 2001 From: Benjamin Bach Date: Fri, 14 Oct 2016 18:34:24 +0200 Subject: [PATCH] Use django_nyt's interface for fetching default settings for new users --- wiki/plugins/notifications/forms.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/wiki/plugins/notifications/forms.py b/wiki/plugins/notifications/forms.py index a4030fcb..ed016cec 100644 --- a/wiki/plugins/notifications/forms.py +++ b/wiki/plugins/notifications/forms.py @@ -6,7 +6,6 @@ from django.forms.models import BaseModelFormSet, modelformset_factory from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext -from django_nyt import settings as notify_settings from django_nyt.models import NotificationType, Settings, Subscription from wiki.core.plugins.base import PluginSettingsFormMixin from wiki.plugins.notifications import models @@ -141,10 +140,7 @@ class SubscriptionForm(PluginSettingsFormMixin, forms.Form): subscription__notification_type=self.notification_type, subscription__settings__user=self.user, ) - self.default_settings = Settings.objects.get_or_create( - user=request.user, - interval=notify_settings.INTERVALS_DEFAULT - )[0] + self.default_settings = Settings.get_default_setting(request.user) if self.edit_notifications: self.default_settings = self.edit_notifications[ 0].subscription.settings -- 2.45.2