Skip to content

Commit

Permalink
Merge branch 'master' into datetimefield-wtforms3
Browse files Browse the repository at this point in the history
  • Loading branch information
Enric Caumons Gou committed Dec 27, 2021
2 parents f3b984e + 79ad7e4 commit 5041018
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
--health-timeout 5s
--health-retries 5
mongo:
image: mongo:3.1
image: mongo:5.0.4-focal
ports:
- 27017:27017
azurite:
Expand All @@ -59,4 +59,4 @@ jobs:
- name: Install tox
run: pip install tox
- name: Run tests
run: tox -e ${{ matrix.tox-version }}
run: tox -e ${{ matrix.tox-version }}
6 changes: 0 additions & 6 deletions TODO.txt

This file was deleted.

2 changes: 1 addition & 1 deletion flask_admin/model/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def display_row_controls(self, field):

def process(self, formdata, data=unset_value, extra_filters=None):
res = super(InlineFieldList, self).process(
formdata, data, extra_filters=extra_filters)
formdata, data)

# Postprocess - contribute flag
if formdata:
Expand Down
4 changes: 2 additions & 2 deletions flask_admin/model/typefmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def bool_formatter(view, value):
Value to check
"""
glyph = 'ok-circle' if value else 'minus-sign'
fa = 'fas fa-check-circle' if value else 'far fa-circle'
return Markup('<span class="%s glyphicon glyphicon-%s icon-%s"></span>' % (fa, glyph, glyph))
fa = 'fa-check-circle' if value else 'fa-minus-circle'
return Markup('<span class="fa %s glyphicon glyphicon-%s icon-%s"></span>' % (fa, glyph, glyph))


def list_formatter(view, values):
Expand Down
3 changes: 2 additions & 1 deletion flask_admin/static/admin/js/bs4_filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,5 +193,6 @@ var AdminFilters = function(element, filtersElement, filterGroups, activeFilters
JSON.parse($('#active-filters-data').text())
);
}
})
});
$(document).trigger('adminFormReady'); // trigger event to allow dynamic filter form to function properly
})(jQuery);
3 changes: 2 additions & 1 deletion flask_admin/templates/bootstrap4/admin/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@
{% set class_name = item.get_class_name() %}
{% if item.is_accessible() and item.is_visible() %}
<li{% if class_name %} class="{{ class_name }}"{% endif %}>
<a class="nav-link" href="{{ item.get_url() }}">{{ menu_icon(item) }}{{ item.name }}</a>
<a class="nav-link" href="{{ item.get_url() }}"{% if item.target %} target="{{ item.target }}"{% endif %}>
{{ menu_icon(item) }}{{ item.name }}</a>
</li>
{% endif %}
{% endfor %}
Expand Down
11 changes: 3 additions & 8 deletions flask_admin/tests/peeweemodel/test_basic.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
from unittest import SkipTest

# Skip test on PY3
from flask_admin._compat import PY2, as_unicode
if not PY2:
raise SkipTest('Peewee is not Python 3 compatible')
from flask_admin._compat import as_unicode

import peewee

Expand Down Expand Up @@ -157,7 +152,7 @@ def test_model():

rv = client.get('/admin/model1/')
assert rv.status_code == 200
assert 'test1large' in rv.data
assert b'test1large' in rv.data

url = '/admin/model1/edit/?id=%s' % model.id
rv = client.get(url)
Expand Down Expand Up @@ -1028,7 +1023,7 @@ class Model2(BaseModel):
client = app.test_client()

req = client.get(u'/admin/view/ajax/lookup/?name=model1&query=foo')
assert req.data == u'[[%s, "foo"]]' % model2.id
assert req.data == b'[[%d, "foo"]]' % model2.id

# Check submitting
client.post('/admin/view/new/', data={u'model1': as_unicode(model.id)})
Expand Down
3 changes: 1 addition & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ pytest-cov
coveralls
pylint
sqlalchemy-citext
sqlalchemy-utils<=0.36.6; python_version < "3.0"
sqlalchemy-utils>=0.36.6; python_version >= "3.0"
sqlalchemy-utils>=0.36.6
azure-storage-blob
arrow<0.14.0
colour
Expand Down

0 comments on commit 5041018

Please sign in to comment.