Archived
1
0

make posting work

This commit is contained in:
Jeff Becker 2016-11-10 08:46:01 -05:00
parent 801272ae7d
commit 2ae4f2268b
No known key found for this signature in database
GPG Key ID: AB950234D6EA286B

View File

@ -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):