mirror of
https://github.com/caronc/apprise-api.git
synced 2025-08-09 14:54:53 +02:00
GET parms: title, type, format, and tag used if not in payload (#84)
This commit is contained in:
@ -471,6 +471,7 @@ class NotifyView(View):
|
||||
content = {}
|
||||
if MIME_IS_FORM.match(request.content_type):
|
||||
content = {}
|
||||
|
||||
form = NotifyForm(request.POST)
|
||||
if form.is_valid():
|
||||
content.update(form.cleaned_data)
|
||||
@ -502,6 +503,34 @@ class NotifyView(View):
|
||||
status=status,
|
||||
)
|
||||
|
||||
#
|
||||
# Allow 'tag' value to be specified as part of the URL parameters
|
||||
# if not found otherwise defined.
|
||||
#
|
||||
if not content.get('tag') and 'tag' in request.GET:
|
||||
content['tag'] = request.GET['tag']
|
||||
|
||||
#
|
||||
# Allow 'format' value to be specified as part of the URL
|
||||
# parameters if not found otherwise defined.
|
||||
#
|
||||
if not content.get('format') and 'format' in request.GET:
|
||||
content['format'] = request.GET['format']
|
||||
|
||||
#
|
||||
# Allow 'type' value to be specified as part of the URL parameters
|
||||
# if not found otherwise defined.
|
||||
#
|
||||
if not content.get('type') and 'type' in request.GET:
|
||||
content['type'] = request.GET['type']
|
||||
|
||||
#
|
||||
# Allow 'title' value to be specified as part of the URL parameters
|
||||
# if not found otherwise defined.
|
||||
#
|
||||
if not content.get('title') and 'title' in request.GET:
|
||||
content['title'] = request.GET['title']
|
||||
|
||||
# Some basic error checking
|
||||
if not content.get('body') or \
|
||||
content.get('type', apprise.NotifyType.INFO) \
|
||||
|
Reference in New Issue
Block a user