Fix typo in document image generation query. Support multiple logins using different sessions iDS.

This commit is contained in:
Roberto Rosario
2016-03-07 04:13:14 -04:00
parent 8a5a26c0b4
commit 9efa7c9543
2 changed files with 4 additions and 2 deletions

View File

@@ -725,7 +725,7 @@ def document_multiple_document_type_edit(request):
# TODO: Get rid of this view and convert widget to use API and base64 only images
def get_document_image(request, document_id, size=setting_preview_size.value):
document = get_object_or_404(Document.passthrough.objects.filter(document_type__organization__id=settings.ORGANIZATION_ID), pk=document_id)
document = get_object_or_404(Document.passthrough.filter(document_type__organization__id=settings.ORGANIZATION_ID), pk=document_id)
try:
Permission.check_permissions(request.user, (permission_document_view,))
except PermissionDenied:

View File

@@ -106,6 +106,7 @@ MIDDLEWARE_CLASSES = (
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'organizations.middleware.CurrentOrganizationMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
@@ -114,7 +115,6 @@ MIDDLEWARE_CLASSES = (
'common.middleware.strip_spaces_widdleware.SpacelessMiddleware',
'authentication.middleware.login_required_middleware.LoginRequiredMiddleware',
'common.middleware.ajax_redirect.AjaxRedirect',
'organizations.middleware.CurrentOrganizationMiddleware',
)
ROOT_URLCONF = 'mayan.urls'
@@ -292,4 +292,6 @@ ORGANIZATION_ID = 1
AUTH_USER_MODEL = 'user_management.MayanUser'
# ------- Authentication -------
AUTHENTICATION_BACKENDS = ('authentication.auth.model_auth_backend.UsernameModelBackend',)
# ------- Session ---------
SESSION_COOKIE_NAME = 'organization-1'