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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user