From 2ae4f2268bafd15781590aa9617d88f0e6c60fa9 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Thu, 10 Nov 2016 08:46:01 -0500 Subject: [PATCH] make posting work --- .../nntpchan/nntpchan/frontend/views.py | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/contrib/frontends/django/nntpchan/nntpchan/frontend/views.py b/contrib/frontends/django/nntpchan/nntpchan/frontend/views.py index 8d761ce..616a094 100644 --- a/contrib/frontends/django/nntpchan/nntpchan/frontend/views.py +++ b/contrib/frontends/django/nntpchan/nntpchan/frontend/views.py @@ -35,17 +35,18 @@ class Postable: handle moderation parameters """ if 'modactions' in request.POST: - actions = request.POST['modactions'] + '\n' - body = '' - for line in actions.split('\n'): - line = line.strip() - if len(line) > 0: - body += '{}\n'.format(line) - key = None - if 'secret' in request.POST: - key = request.POST['secret'] - _, err = util.createPost('ctl', '', {'message': body}, {}, key) - return True, err + actions = request.POST['modactions'] + if len(actions) > 0: + body = '' + for line in actions.split('\n'): + line = line.strip() + if len(line) > 0: + body += '{}\n'.format(line) + key = None + if 'secret' in request.POST: + key = request.POST['secret'] + _, err = util.createPost('ctl', '', {'message': body}, {}, key) + return True, err return False, None def post(self, request, **kwargs):