mirror of
https://github.com/caronc/apprise-api.git
synced 2024-12-12 18:00:51 +01:00
enforce text based input
This commit is contained in:
parent
0899a5a2b3
commit
4c53995456
@ -399,8 +399,13 @@ class NotifyView(View):
|
|||||||
status=ResponseCode.internal_server_error,
|
status=ResponseCode.internal_server_error,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Prepare ourselves a default Asset
|
||||||
|
asset = apprise.AppriseAsset(
|
||||||
|
body_format=apprise.NotifyFormat.TEXT,
|
||||||
|
)
|
||||||
|
|
||||||
# Prepare our apprise object
|
# Prepare our apprise object
|
||||||
a_obj = apprise.Apprise()
|
a_obj = apprise.Apprise(asset=asset)
|
||||||
|
|
||||||
# Create an apprise config object
|
# Create an apprise config object
|
||||||
ac_obj = apprise.AppriseConfig()
|
ac_obj = apprise.AppriseConfig()
|
||||||
@ -482,8 +487,13 @@ class StatelessNotifyView(View):
|
|||||||
_('An invalid payload was specified.'),
|
_('An invalid payload was specified.'),
|
||||||
status=ResponseCode.bad_request)
|
status=ResponseCode.bad_request)
|
||||||
|
|
||||||
|
# Prepare ourselves a default Asset
|
||||||
|
asset = apprise.AppriseAsset(
|
||||||
|
body_format=apprise.NotifyFormat.TEXT,
|
||||||
|
)
|
||||||
|
|
||||||
# Prepare our apprise object
|
# Prepare our apprise object
|
||||||
a_obj = apprise.Apprise()
|
a_obj = apprise.Apprise(asset=asset)
|
||||||
|
|
||||||
# Add URLs
|
# Add URLs
|
||||||
a_obj.add(content.get('urls'))
|
a_obj.add(content.get('urls'))
|
||||||
|
Loading…
Reference in New Issue
Block a user