Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
flask-admin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Python-Dev
flask-admin
Commits
1a911ddc
Unverified
Commit
1a911ddc
authored
Oct 18, 2018
by
Petrus Janse van Rensburg
Committed by
GitHub
Oct 18, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1726 from kongminhao/master
Fix #1725
parents
806fed17
674c7f0e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
_compat.py
flask_admin/_compat.py
+2
-1
__init__.py
flask_admin/contrib/fileadmin/__init__.py
+2
-2
No files found.
flask_admin/_compat.py
View file @
1a911ddc
...
...
@@ -38,7 +38,7 @@ if not PY2:
# Various tools
from
functools
import
reduce
from
urllib.parse
import
urljoin
,
urlparse
from
urllib.parse
import
urljoin
,
urlparse
,
quote
else
:
text_type
=
unicode
string_types
=
(
str
,
unicode
)
...
...
@@ -62,6 +62,7 @@ else:
# Helpers
reduce
=
__builtins__
[
'reduce'
]
if
isinstance
(
__builtins__
,
dict
)
else
__builtins__
.
reduce
from
urlparse
import
urljoin
,
urlparse
from
urllib
import
quote
def
with_metaclass
(
meta
,
*
bases
):
...
...
flask_admin/contrib/fileadmin/__init__.py
View file @
1a911ddc
...
...
@@ -12,7 +12,7 @@ from werkzeug import secure_filename
from
wtforms
import
fields
,
validators
from
flask_admin
import
form
,
helpers
from
flask_admin._compat
import
urljoin
,
as_unicode
from
flask_admin._compat
import
urljoin
,
as_unicode
,
quote
from
flask_admin.base
import
BaseView
,
expose
from
flask_admin.actions
import
action
,
ActionsMixin
from
flask_admin.babel
import
gettext
,
lazy_gettext
...
...
@@ -944,7 +944,7 @@ class BaseFileAdmin(BaseView, ActionsMixin):
base_url
=
self
.
get_base_url
()
if
base_url
:
base_url
=
urljoin
(
self
.
get_url
(
'.index_view'
),
base_url
)
return
redirect
(
urljoin
(
base_url
,
path
))
return
redirect
(
urljoin
(
quote
(
base_url
),
quote
(
path
)
))
return
self
.
storage
.
send_file
(
directory
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment