- if parent_revision is not None:
- parent = doc.at_revision(parent_revision)
- else:
- parent = None
- stage = form.cleaned_data['stage_completed']
- tags = [stage] if stage else []
- publishable = (form.cleaned_data['publishable'] and
- request.user.has_perm('catalogue.can_pubmark'))
- doc.commit(author=author,
- text=text,
- parent=parent,
- description=form.cleaned_data['comment'],
- tags=tags,
- author_name=form.cleaned_data['author_name'],
- author_email=form.cleaned_data['author_email'],
- publishable=publishable,
- )