fix making new threads
This commit is contained in:
parent
64b345a7f0
commit
2a744c45a2
@ -49,8 +49,9 @@ 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)
|
||||
if ref:
|
||||
msg["References"] = ref
|
||||
msg["Newsgroups"] = newsgroup
|
||||
msg["From"] = '{} <anon@django.nntpchan.tld>'.format(form['name'] or 'Anonymous')
|
||||
|
@ -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):
|
||||
|
Reference in New Issue
Block a user