diff --git a/contrib/frontends/django/nntpchan/nntpchan/frontend/util.py b/contrib/frontends/django/nntpchan/nntpchan/frontend/util.py index cb0269d..1ab17c6 100644 --- a/contrib/frontends/django/nntpchan/nntpchan/frontend/util.py +++ b/contrib/frontends/django/nntpchan/nntpchan/frontend/util.py @@ -49,9 +49,10 @@ def createPost(newsgroup, ref, form, files): msg["Subject"] = form["subject"] or "None" msg['Date'] = email.utils.format_datetime(datetime.now()) msg['Message-ID'] = email.utils.make_msgid(randstr(13), settings.FRONTEND_NAME) - if not msgid_valid(ref): + if ref and not msgid_valid(ref): return None, "invalid reference: {}".format(ref) - msg["References"] = ref + if ref: + msg["References"] = ref msg["Newsgroups"] = newsgroup msg["From"] = '{} '.format(form['name'] or 'Anonymous') if 'attachment' in files: diff --git a/contrib/frontends/django/nntpchan/nntpchan/frontend/views.py b/contrib/frontends/django/nntpchan/nntpchan/frontend/views.py index 56ab2da..869b0c8 100644 --- a/contrib/frontends/django/nntpchan/nntpchan/frontend/views.py +++ b/contrib/frontends/django/nntpchan/nntpchan/frontend/views.py @@ -57,7 +57,7 @@ class BoardView(generic.View, Postable): name = 'overchan.{}'.format(name) if not util.newsgroup_valid(name): return None, "invalid newsgroup: {}".format(name) - return util.createPost(name, '', request.POST, request.FILES) + return util.createPost(name, None, request.POST, request.FILES) def get(self, request, name):