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
b9c71bbc
Commit
b9c71bbc
authored
Sep 05, 2016
by
Andrew Grigorev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GeoJSONField._value() shouldn't return None
parent
eabc326e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
fields.py
flask_admin/contrib/geoa/fields.py
+2
-0
test_basic.py
flask_admin/tests/geoa/test_basic.py
+27
-0
No files found.
flask_admin/contrib/geoa/fields.py
View file @
b9c71bbc
...
...
@@ -58,6 +58,8 @@ class GeoJSONField(JSONField):
)
)
)
else
:
return
''
def
process_formdata
(
self
,
valuelist
):
super
(
GeoJSONField
,
self
)
.
process_formdata
(
valuelist
)
...
...
flask_admin/tests/geoa/test_basic.py
View file @
b9c71bbc
...
...
@@ -168,3 +168,30 @@ def test_mapbox_fix_point_coordinates():
# Reversed order again, so that it's parsed correctly by leaflet
eq_
(
p
[
'coordinates'
][
0
],
10.0
)
eq_
(
p
[
'coordinates'
][
1
],
125.8
)
def
test_none
():
app
,
db
,
admin
=
setup
()
GeoModel
=
create_models
(
db
)
db
.
create_all
()
GeoModel
.
query
.
delete
()
db
.
session
.
commit
()
view
=
ModelView
(
GeoModel
,
db
.
session
)
admin
.
add_view
(
view
)
# Make some test clients
client
=
app
.
test_client
()
rv
=
client
.
post
(
'/admin/geomodel/new/'
,
data
=
{
"name"
:
"test1"
,
})
eq_
(
rv
.
status_code
,
302
)
model
=
db
.
session
.
query
(
GeoModel
)
.
first
()
url
=
'/admin/geomodel/edit/?id=
%
s'
%
model
.
id
rv
=
client
.
get
(
url
)
eq_
(
rv
.
status_code
,
200
)
data
=
rv
.
data
.
decode
(
'utf-8'
)
ok_
(
r' name="point"></textarea>'
in
data
)
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