Implement custom notification settings
This commit is contained in:
@@ -3,7 +3,16 @@ from django.contrib.auth.forms import UserCreationForm
|
||||
from django.core.exceptions import FieldDoesNotExist
|
||||
from django.forms import ModelForm
|
||||
|
||||
from .models import Account, Hook, Signal, Strategy, Trade, TradingTime, User
|
||||
from .models import (
|
||||
Account,
|
||||
Hook,
|
||||
NotificationSettings,
|
||||
Signal,
|
||||
Strategy,
|
||||
Trade,
|
||||
TradingTime,
|
||||
User,
|
||||
)
|
||||
|
||||
# flake8: noqa: E501
|
||||
|
||||
@@ -276,3 +285,16 @@ class TradingTimeForm(RestrictedFormMixin, ModelForm):
|
||||
"end_day": "The day of the week to stop trading.",
|
||||
"end_time": "The time of day to stop trading.",
|
||||
}
|
||||
|
||||
|
||||
class NotificationSettingsForm(RestrictedFormMixin, ModelForm):
|
||||
class Meta:
|
||||
model = NotificationSettings
|
||||
fields = (
|
||||
"ntfy_topic",
|
||||
"ntfy_url",
|
||||
)
|
||||
help_texts = {
|
||||
"ntfy_topic": "The topic to send notifications to.",
|
||||
"ntfy_url": "Custom NTFY server. Leave blank to use the default server.",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user