-
-def _create_post(request, post_cls, form, parent=None):
- post = post_cls()
-
- if parent is not None:
- post.parent = parent
-
- revision_data = dict(summary=_('Initial revision'), body=form.cleaned_data['text'])
-
- if form.cleaned_data.get('title', None):
- revision_data['title'] = strip_tags(form.cleaned_data['title'].strip())
-
- if form.cleaned_data.get('tags', None):
- revision_data['tagnames'] = form.cleaned_data['tags'].strip()
-
- post.create_revision(request.user, **revision_data)
-
- if form.cleaned_data['wiki']:
- post.wikify()
-
- return HttpResponseRedirect(post.get_absolute_url())
-
-
-