Merge branch 'hotfix/v0.12.2' into development
Conflicts: apps/common/__init__.py apps/documents/forms.py apps/feedback/__init__.py apps/history/__init__.py apps/main/__init__.py apps/scheduler/api.py apps/sources/models.py docs/releases/index.rst requirements/production.txt settings.py urls.py
This commit is contained in:
BIN
apps/sources/locale/de_DE/LC_MESSAGES/django.mo
Normal file
BIN
apps/sources/locale/de_DE/LC_MESSAGES/django.mo
Normal file
Binary file not shown.
530
apps/sources/locale/de_DE/LC_MESSAGES/django.po
Normal file
530
apps/sources/locale/de_DE/LC_MESSAGES/django.po
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -26,7 +26,7 @@ from django.core.files.base import ContentFile
|
||||
from converter.api import get_available_transformations_choices
|
||||
from converter.literals import DIMENSION_SEPARATOR
|
||||
from documents.models import DocumentType, Document
|
||||
from documents.literals import HISTORY_DOCUMENT_CREATED
|
||||
from documents.events import HISTORY_DOCUMENT_CREATED
|
||||
from document_indexing.api import update_indexes
|
||||
from history.api import create_history
|
||||
from metadata.models import MetadataType
|
||||
@@ -133,7 +133,7 @@ class BaseModel(models.Model):
|
||||
new_version_data = {}
|
||||
|
||||
try:
|
||||
new_version = document.new_version(file=file_object, **new_version_data)
|
||||
new_version = document.new_version(file=file_object, user=user, **new_version_data)
|
||||
except Exception, exc:
|
||||
logger.error('Unhandled exception: %s' % exc)
|
||||
# Don't leave the database in a broken state
|
||||
|
||||
@@ -17,6 +17,7 @@ from documents.permissions import (PERMISSION_DOCUMENT_CREATE,
|
||||
PERMISSION_DOCUMENT_NEW_VERSION)
|
||||
from documents.models import DocumentType, Document
|
||||
from documents.conf.settings import THUMBNAIL_SIZE
|
||||
from documents.exceptions import NewDocumentVersionNotAllowed
|
||||
from metadata.api import decode_metadata_from_url, metadata_repr_as_list
|
||||
from permissions.models import Permission
|
||||
from common.utils import encapsulate
|
||||
@@ -174,6 +175,8 @@ def upload_interactive(request, source_type=None, source_id=None, document_pk=No
|
||||
messages.warning(request, _(u'File was not a compressed file, uploaded as it was.'))
|
||||
|
||||
return HttpResponseRedirect(request.get_full_path())
|
||||
except NewDocumentVersionNotAllowed:
|
||||
messages.error(request, _(u'New version uploads are not allowed for this document.'))
|
||||
except Exception, e:
|
||||
if settings.DEBUG:
|
||||
raise
|
||||
@@ -253,6 +256,8 @@ def upload_interactive(request, source_type=None, source_id=None, document_pk=No
|
||||
return HttpResponseRedirect(reverse('document_view_simple', args=[document.pk]))
|
||||
else:
|
||||
return HttpResponseRedirect(request.get_full_path())
|
||||
except NewDocumentVersionNotAllowed:
|
||||
messages.error(request, _(u'New version uploads are not allowed for this document.'))
|
||||
except Exception, e:
|
||||
if settings.DEBUG:
|
||||
raise
|
||||
|
||||
Reference in New Issue
Block a user