mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-30 19:10:42 -04:00
Allow callbacks to be removed
We’ve had a user who’s said: > Seems configured callbacks cannot be removed once they’re set as the > fields have a presence check. Is that intentional? This means it’s not working as they expect. Rather than have to go and change stuff in the database for them, let’s make it work as they’d expect. Only lets you clear the form if you remove both the token and the URL.
This commit is contained in:
committed by
Leo Hemsted
parent
418a744283
commit
c2dbc1934f
@@ -826,7 +826,15 @@ class ServiceInboundNumberForm(StripWhitespaceForm):
|
||||
)
|
||||
|
||||
|
||||
class ServiceReceiveMessagesCallbackForm(StripWhitespaceForm):
|
||||
class CallbackForm(StripWhitespaceForm):
|
||||
|
||||
def validate(self):
|
||||
return super().validate() or (
|
||||
self.url.data == '' and self.bearer_token.data == ''
|
||||
)
|
||||
|
||||
|
||||
class ServiceReceiveMessagesCallbackForm(CallbackForm):
|
||||
url = StringField(
|
||||
"URL",
|
||||
validators=[DataRequired(message='Can’t be empty'),
|
||||
@@ -839,7 +847,7 @@ class ServiceReceiveMessagesCallbackForm(StripWhitespaceForm):
|
||||
)
|
||||
|
||||
|
||||
class ServiceDeliveryStatusCallbackForm(StripWhitespaceForm):
|
||||
class ServiceDeliveryStatusCallbackForm(CallbackForm):
|
||||
url = StringField(
|
||||
"URL",
|
||||
validators=[DataRequired(message='Can’t be empty'),
|
||||
|
||||
Reference in New Issue
Block a user