fixes
This commit is contained in:
parent
487495f9ac
commit
6cdcc4c3b9
@ -78,4 +78,4 @@ def createPost(newsgroup, ref, form, files):
|
||||
response = nntp.post(msg.as_bytes())
|
||||
except Exception as e:
|
||||
return None, 'connection to backend failed, {}'.format(e)
|
||||
return response, None
|
||||
return msg["Message-ID"], None
|
||||
|
@ -44,6 +44,8 @@ class Postable:
|
||||
code = 201
|
||||
if ctx['error']:
|
||||
code = 200
|
||||
else:
|
||||
ctx['refresh_url'] = reverse('frontend:thread', args=[util.hashid(ctx['msgid'])])
|
||||
return HttpResponse(content=render(request, 'frontend/postresult.html', ctx), status=code)
|
||||
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
<pre class="error"> failed to post: {{error}} </pre>
|
||||
{% else %}
|
||||
{% if msgid %}
|
||||
<pre class="posted"> {{msgid}} </pre>
|
||||
<pre class="posted"> posted as {{msgid}} </pre>
|
||||
{% else %}
|
||||
<pre class="posted"> message was not posted </pre>
|
||||
{% endif %}
|
||||
|
@ -96,7 +96,7 @@ def webhook(request):
|
||||
continue
|
||||
filename = part.get_filename()
|
||||
mtype = part.get_content_type()
|
||||
ext = filename.split('.')[-1]
|
||||
ext = filename.split('.')[-1].lower()
|
||||
fh = util.hashfile(bytes(payload))
|
||||
fn = fh + '.' + ext
|
||||
fname = os.path.join(settings.MEDIA_ROOT, fn)
|
||||
|
Reference in New Issue
Block a user