"text_revert": forms.DocumentTextRevertForm(prefix="textrevert"),
"pubmark": forms.DocumentPubmarkForm(prefix="pubmark"),
},
+ 'can_pubmark': request.user.has_perm('catalogue.can_pubmark'),
'REDMINE_URL': settings.REDMINE_URL,
})
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,
tags=tags,
author_name=form.cleaned_data['author_name'],
author_email=form.cleaned_data['author_email'],
+ publishable=publishable,
)
revision = doc.revision()
return JSONResponse({
try:
base_url = ''.join((
smart_unicode(settings.MEDIA_URL),
- smart_unicode(settings.FILEBROWSER_DIRECTORY),
+ smart_unicode(settings.IMAGE_DIR),
smart_unicode(directory)))
base_dir = os.path.join(
smart_unicode(settings.MEDIA_ROOT),
- smart_unicode(settings.FILEBROWSER_DIRECTORY),
+ smart_unicode(settings.IMAGE_DIR),
smart_unicode(directory))
def map_to_url(filename):