mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-18 13:39:57 -04:00
Let users switch channels on and off by themselves
We let people do this for letters already. We should let them do it for emails and texts too, rather than have to email us.
This commit is contained in:
@@ -696,10 +696,18 @@ class ServiceLetterContactBlockForm(StripWhitespaceForm):
|
||||
)
|
||||
|
||||
|
||||
class ServiceSwitchLettersForm(StripWhitespaceForm):
|
||||
class ServiceSwitchChannelForm(StripWhitespaceForm):
|
||||
|
||||
def __init__(self, channel, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.enabled.label.text = 'Send {}'.format({
|
||||
'email': 'emails',
|
||||
'sms': 'text messages',
|
||||
'letter': 'letters',
|
||||
}.get(channel))
|
||||
|
||||
enabled = RadioField(
|
||||
'Send letters',
|
||||
'Choices',
|
||||
choices=[
|
||||
('on', 'On'),
|
||||
('off', 'Off'),
|
||||
|
||||
Reference in New Issue
Block a user