Add custom script_prefix aware resolve function and use it for the

document page navigation views. Fixes issue with Mayan installed
as a sub URL app. Fixes GitLab issue #383. Thanks to @gsteixei
for the issue and investigation.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2017-05-29 14:35:09 -04:00
parent 42c72001b6
commit 68dbdb111a
4 changed files with 19 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
2.2.1 (2017-05-25)
2.2.1 (2017-05-XX)
==================
- Allow for bigger indexing expression templates.
- Auto select checkbox when updating metadata values. GitLab issue #371.
@@ -9,6 +9,7 @@
- Rewrite document indexing code to be faster and use less locking.
- Use a predefined file path for the file lock.
- Catch documents with not document version when displaying their thumbnails.
- Document page navigation fix when using Mayan as a sub URL app.
2.2 (2017-04-26)
================

View File

@@ -22,9 +22,15 @@ Changes
About menu.
- Add support for rebuilding specific indexes instead of only being able to
rebuild all index.
- Rewrite document indexing code to be faster and use less locking.
- Rewrite document indexing code to be faster and use less locking. Thanks to
Macrobb Simpson (@Macrobb) for the initial implementation.
- Use a predefined file path for the file lock.
- Catch documents with not document version when displaying their thumbnails.
- Add custom script_prefix aware resolve function and use it for the
document page navigation views. Fixes an issue when Mayan is installed
as a sub URL app. Thanks to Gustavo Teixeira(@gsteixei) for the issue and
investigation.
Removals
--------
@@ -80,6 +86,7 @@ Bugs fixed or issues closed
===========================
* `GitLab issue #371 <https://gitlab.com/mayan-edms/mayan-edms/issues/371>`_ Auto select checkbox when updating metadata
* `GitLab issue #383 <https://gitlab.com/mayan-edms/mayan-edms/issues/383>`_ Page not found when deployed to sub-uri
* `GitLab issue #385 <https://gitlab.com/mayan-edms/mayan-edms/issues/385>`_ mountindex: how to specify FUSE mount option allow_other?
.. _PyPI: https://pypi.python.org/pypi/mayan-edms/

View File

@@ -8,6 +8,8 @@ import types
import xmlrpclib
from django.conf import settings
from django.core.urlresolvers import resolve as django_resolve
from django.urls.base import get_script_prefix
from django.utils.datastructures import MultiValueDict
from django.utils.http import urlquote as django_urlquote
from django.utils.http import urlencode as django_urlencode
@@ -108,6 +110,11 @@ def mkstemp(*args, **kwargs):
return tempfile.mkstemp(*args, **kwargs)
def resolve(path, urlconf=None):
path = '/{}'.format(path.replace(get_script_prefix(), '', 1))
return django_resolve(path=path, urlconf=urlconf)
def return_attrib(obj, attrib, arguments=None):
try:
if isinstance(attrib, types.FunctionType):

View File

@@ -5,7 +5,7 @@ import urlparse
from django.conf import settings
from django.contrib import messages
from django.core.urlresolvers import resolve, reverse
from django.core.urlresolvers import reverse
from django.shortcuts import get_object_or_404
from django.utils.http import urlencode
from django.utils.translation import ugettext_lazy as _
@@ -13,6 +13,7 @@ from django.views.generic import RedirectView
from acls.models import AccessControlList
from common.generics import SimpleView, SingleObjectListView
from common.utils import resolve
from converter.literals import DEFAULT_ROTATION, DEFAULT_ZOOM_LEVEL
from ..forms import DocumentPageForm