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())
|
response = nntp.post(msg.as_bytes())
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return None, 'connection to backend failed, {}'.format(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
|
code = 201
|
||||||
if ctx['error']:
|
if ctx['error']:
|
||||||
code = 200
|
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)
|
return HttpResponse(content=render(request, 'frontend/postresult.html', ctx), status=code)
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<pre class="error"> failed to post: {{error}} </pre>
|
<pre class="error"> failed to post: {{error}} </pre>
|
||||||
{% else %}
|
{% else %}
|
||||||
{% if msgid %}
|
{% if msgid %}
|
||||||
<pre class="posted"> {{msgid}} </pre>
|
<pre class="posted"> posted as {{msgid}} </pre>
|
||||||
{% else %}
|
{% else %}
|
||||||
<pre class="posted"> message was not posted </pre>
|
<pre class="posted"> message was not posted </pre>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -96,7 +96,7 @@ def webhook(request):
|
|||||||
continue
|
continue
|
||||||
filename = part.get_filename()
|
filename = part.get_filename()
|
||||||
mtype = part.get_content_type()
|
mtype = part.get_content_type()
|
||||||
ext = filename.split('.')[-1]
|
ext = filename.split('.')[-1].lower()
|
||||||
fh = util.hashfile(bytes(payload))
|
fh = util.hashfile(bytes(payload))
|
||||||
fn = fh + '.' + ext
|
fn = fh + '.' + ext
|
||||||
fname = os.path.join(settings.MEDIA_ROOT, fn)
|
fname = os.path.join(settings.MEDIA_ROOT, fn)
|
||||||
|
Reference in New Issue
Block a user