make posting work
This commit is contained in:
parent
801272ae7d
commit
2ae4f2268b
@ -35,17 +35,18 @@ class Postable:
|
|||||||
handle moderation parameters
|
handle moderation parameters
|
||||||
"""
|
"""
|
||||||
if 'modactions' in request.POST:
|
if 'modactions' in request.POST:
|
||||||
actions = request.POST['modactions'] + '\n'
|
actions = request.POST['modactions']
|
||||||
body = ''
|
if len(actions) > 0:
|
||||||
for line in actions.split('\n'):
|
body = ''
|
||||||
line = line.strip()
|
for line in actions.split('\n'):
|
||||||
if len(line) > 0:
|
line = line.strip()
|
||||||
body += '{}\n'.format(line)
|
if len(line) > 0:
|
||||||
key = None
|
body += '{}\n'.format(line)
|
||||||
if 'secret' in request.POST:
|
key = None
|
||||||
key = request.POST['secret']
|
if 'secret' in request.POST:
|
||||||
_, err = util.createPost('ctl', '', {'message': body}, {}, key)
|
key = request.POST['secret']
|
||||||
return True, err
|
_, err = util.createPost('ctl', '', {'message': body}, {}, key)
|
||||||
|
return True, err
|
||||||
return False, None
|
return False, None
|
||||||
|
|
||||||
def post(self, request, **kwargs):
|
def post(self, request, **kwargs):
|
||||||
|
Reference in New Issue
Block a user