diff --git a/contrib/frontends/django/nntpchan/nntpchan/frontend/util.py b/contrib/frontends/django/nntpchan/nntpchan/frontend/util.py index a48fc74..a757540 100644 --- a/contrib/frontends/django/nntpchan/nntpchan/frontend/util.py +++ b/contrib/frontends/django/nntpchan/nntpchan/frontend/util.py @@ -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 diff --git a/contrib/frontends/django/nntpchan/nntpchan/frontend/views.py b/contrib/frontends/django/nntpchan/nntpchan/frontend/views.py index 59d5e8c..af803d6 100644 --- a/contrib/frontends/django/nntpchan/nntpchan/frontend/views.py +++ b/contrib/frontends/django/nntpchan/nntpchan/frontend/views.py @@ -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) diff --git a/contrib/frontends/django/nntpchan/nntpchan/templates/frontend/postresult.html b/contrib/frontends/django/nntpchan/nntpchan/templates/frontend/postresult.html index f31efd2..afa316e 100644 --- a/contrib/frontends/django/nntpchan/nntpchan/templates/frontend/postresult.html +++ b/contrib/frontends/django/nntpchan/nntpchan/templates/frontend/postresult.html @@ -9,7 +9,7 @@
failed to post: {{error}}{% else %} {% if msgid %} -
{{msgid}}+
posted as {{msgid}}{% else %}
message was not posted{% endif %} diff --git a/contrib/frontends/django/nntpchan/nntpchan/views.py b/contrib/frontends/django/nntpchan/nntpchan/views.py index 2414981..1093711 100644 --- a/contrib/frontends/django/nntpchan/nntpchan/views.py +++ b/contrib/frontends/django/nntpchan/nntpchan/views.py @@ -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)